Home | History | Annotate | Download | only in src

Lines Matching defs:Test

32 // Google C++ Testing Framework (Google Test)
34 // Sometimes it's desirable to build Google Test by compiling a single file.
78 // The Google C++ Testing Framework (Google Test)
111 // Utilities for testing Google Test itself and code that uses Google Test
112 // (e.g. frameworks built on top of Google Test).
120 // This helper class can be used to mock out Google Test failure reporting
121 // so that we can test Google Test or code that builds on Google Test.
124 // TestPartResultArray object given in the constructor whenever a Google Test
138 // The c'tor sets this object as the test part result reporter used
139 // by Google Test. The 'result' parameter specifies where to report the
148 // The d'tor restores the previous test part result reporter.
193 // A set of macros for testing Google Test assertions or code that's expected
194 // to generate Google Test fatal failures. It verifies that the given
195 // statement will cause exactly one fatal Google Test failure with 'substr'
214 // works. The AcceptsMacroThatExpandsToUnprotectedComma test in
250 // A macro for testing Google Test assertions or code that's expected to
251 // generate Google Test non-fatal failures. It asserts that the given
252 // statement will cause exactly one non-fatal Google Test failure with 'substr'
274 // AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc
404 // Indicates that this translation unit is part of Google Test's
443 // This file contains purely Google Test's internal implementation. Please
450 // part of Google Test's implementation; otherwise it's undefined.
453 # error "gtest-internal-inl.h is part of Google Test's internal implementation."
454 # error "It must not be included except by Google Test itself."
484 // Google Test's own unit tests to be able to access it. Therefore we
490 // The value of GetTestTypeId() as seen from within the Google Test
494 // Names of the flags (needed for parsing Google Test flags).
521 // Returns true iff Google Test should use colors in the output.
566 // This class saves the values of all Google Test flags in its c'tor, and
669 // disabled because it must only be applied to the original test
680 // Given the total number of shards, the shard index, and the test id,
681 // returns true iff the test should be run on this shard. The test id is
682 // some arbitrary but unique non-negative integer assigned to each test
763 // Returns true iff the test name of test property matches on key_.
779 // test filter using either GTEST_FILTER or --gtest_filter. If both
800 // works well enough for matching test names, which are short.
803 // Returns true iff the user-specified filter matches the test case
804 // name and the test name.
811 // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
840 // UponLeavingGTest() should be called immediately before Google Test calls
842 // CurrentStackTrace() will use to find and hide Google Test stack frames.
860 // Google Test's implementation.
875 // Information about a Google Test trace point.
882 // This is the default global test part result reporter used in UnitTestImpl.
888 // Implements the TestPartResultReporterInterface. Reports the test part
889 // result in the current test.
898 // This is the default per thread test part result reporter used in
905 // delegates to the current global test part result reporter of *unit_test_.
924 // You can register your own repoter to listen either only for test results
926 // By default, each per-thread test result repoter just passes a new
927 // TestPartResult to the global test result reporter, which registers the
928 // test part result for the currently running test.
930 // Returns the global test part result reporter.
933 // Sets the global test part result reporter.
937 // Returns the test part result reporter for the current thread.
940 // Sets the test part result reporter for the current thread.
944 // Gets the number of successful test cases.
947 // Gets the number of failed test cases.
950 // Gets the number of all test cases.
953 // Gets the number of all test cases that contain at least one test
978 // Gets the time of the test program start, in ms from the start of the
985 // Returns true iff the unit test passed (i.e. all test cases passed).
988 // Returns true iff the unit test failed (i.e. some test case failed
994 // Gets the i-th test case among all the test cases. i can range from 0 to
1001 // Gets the i-th test case among all the test cases. i can range from 0 to
1011 // Returns the TestResult for the test that's currently running, or
1012 // the TestResult for the ad hoc test if no test is running.
1015 // Returns the TestResult for the ad hoc test.
1047 // test_case_name: name of the test case
1048 // type_param: the name of the test's type parameter, or NULL if
1049 // this is not a typed or a type-parameterized test.
1050 // set_up_tc: pointer to the function that sets up the test case
1051 // tear_down_tc: pointer to the function that tears down the test case
1054 Test::SetUpTestCaseFunc set_up_tc,
1055 Test::TearDownTestCaseFunc tear_down_tc);
1057 // Adds a TestInfo to the unit test.
1061 // set_up_tc: pointer to the function that sets up the test case
1062 // tear_down_tc: pointer to the function that tears down the test case
1064 void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
1065 Test::TearDownTestCaseFunc tear_down_tc,
1068 // remember the original working directory when the test program
1072 // AddTestInfo(), which is called to register a TEST or TEST_F
1094 // Sets the TestCase object for the test that's currently running.
1099 // Sets the TestInfo object for the test that's currently running. If
1107 // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter
1116 // thrown during a test, this test is considered to be failed, but
1125 // Clears the results of ad-hoc test assertions.
1131 // context of a test or a test case, or to the global property set. If the
1141 // Matches the full name of each test against the user-specified
1142 // filter to decide whether the test should run, then records the
1160 // Getters for the per-thread Google Test trace stack.
1174 // This information is useful only in a death test child process.
1180 // Returns a pointer to the current death test factory.
1195 // Initializes the event listener for streaming test results to a socket.
1207 // Gets the random seed used at the start of the current test iteration.
1213 // Shuffles all test cases, and the tests within each test case,
1217 // Restores the test cases and tests to their order before the first shuffle.
1234 TEST() or TEST_F() was
1238 // The default test part result reporters.
1243 // Points to (but doesn't own) the global test part result reporter.
1249 // Points to (but doesn't own) the per-thread test part result reporter.
1261 // Provides a level of indirection for the test case list to allow
1262 // easy shuffling and restoring the test case order. The i-th
1263 // element of this vector is the index of the i-th test case in the
1276 // Index of the last death test case registered. Initially -1.
1279 // This points to the TestCase for the currently running test. It
1280 // changes as Google Test goes through one test case after another.
1281 // When no test is running, this is set to NULL and Google Test
1285 // This points to the TestInfo for the currently running test. It
1286 // changes as Google Test goes through one test after another. When
1287 // no test is running, this is set to NULL and Google Test stores
1291 // Normally, a user only writes assertions inside a TEST or TEST_F,
1292 // or inside a function called by a TEST or TEST_F. Since Google
1293 // Test keeps track of which test is current running, it can
1294 // associate such an assertion with the test it belongs to.
1296 // If an assertion is encountered when no TEST or TEST_F is running,
1297 // Google Test attributes the assertion result to an imaginary "ad hoc"
1298 // test, and records the result in ad_hoc_test_result_.
1302 // Google Test.
1314 // The random number seed used at the beginning of the test run.
1320 // The time of the test program start, in ms from the start of the
1324 // How long the test took to run, in milliseconds.
1371 // Parses the command line for Google Test flags, without initializing
1372 // other parts of Google Test.
1455 // Google Test user but are required for testing. This class allow our tests
1458 // This class is supplied only for the purpose of testing Google Test's own
1480 // Streams test results to the given port on the given host machine.
1560 // Note that Google Test current only report elapsed time for each
1561 // test iteration, not for the entire test program.
1645 // A test whose test case name or test name matches this filter is
1649 // A test case whose name matches this filter is considered a death
1650 // test case and will be run before test cases whose name doesn't
1654 // A test filter that matches everything.
1660 // The environment variable name for the test shard index.
1662 // The environment variable name for the total number of test shards.
1664 // The environment variable name for the test shard status file.
1697 " should catch exceptions and treat them as test failures.");
1713 "exclude). A test is run if it matches one of the positive "
1720 "have to match the test's parameters.");
1733 "within that directory, with file-names based on the test "
1746 "Random number seed to use when shuffling test orders. Must be in range "
1752 "How many times to repeat each test. Specify a negative number "
1758 "printing test failure stack traces.");
1776 "test results. Example: \"localhost:555\". The flag is effective only on "
1808 // Google Test. Useful for catching the user mistake of not initializing
1809 // Google Test before calling RUN_ALL_TESTS().
1812 // Test. g_init_gtest_count is set to the number of times
1830 // Returns true iff the test case passed.
1835 // Returns true iff the test case failed.
1840 // Returns true iff test_case contains at least one test that should
1939 // works well enough for matching test names, which are short.
1978 // Returns true iff the user-specified filter matches the test case
1979 // name and the test name.
2003 // test if any pattern in it matches the test.
2009 // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
2013 // Google Test should handle a SEH exception if:
2038 // The c'tor sets this object as the test part result reporter used by
2039 // Google Test. The 'result' parameter specifies where to report the
2048 // The c'tor sets this object as the test part result reporter used by
2049 // Google Test. The 'result' parameter specifies where to report the
2069 // The d'tor restores the test part result reporter used by Google Test
2080 // Increments the test part result count and remembers the result.
2089 // Returns the type ID of ::testing::Test. We should always call this
2090 // instead of GetTypeId< ::testing::Test>() to get the type ID of
2091 // testing::Test. This is to work around a suspected linker bug when
2092 // using Google Test as a framework on Mac OS X. The bug causes
2093 // GetTypeId< ::testing::Test>() to return different values depending
2094 // on whether the call is from the Google Test framework itself or
2095 // from user test code. GetTestTypeId() is guaranteed to always
2097 // gtest.cc, which is within the Google Test framework.
2099 return GetTypeId<Test>();
2102 // The value of GetTestTypeId() as seen from within the Google Test
2106 // This predicate-formatter checks that 'results' contains a test part
2146 // test part results, what type of failure we expect, and what
2181 // Returns the global test part result reporter.
2188 // Sets the global test part result reporter.
2195 // Returns the test part result reporter for the current thread.
2201 // Sets the test part result reporter for the current thread.
2207 // Gets the number of successful test cases.
2212 // Gets the number of failed test cases.
2217 // Gets the number of all test cases.
2222 // Gets the number of all test cases that contain at least one test
3177 // Appends the user-supplied message to the Google-Test-generated message.
3203 // Returns the i-th test part result among all the results. i can
3212 // Returns the i-th test property. i can range from 0 to
3221 // Clears the test part results.
3226 // Adds a test part result to the list.
3231 // Adds a test property to the list. If a property with the same key as the
3346 // Returns true iff the test failed.
3355 // Returns true iff the test part fatally failed.
3360 // Returns true iff the test fatally failed.
3365 // Returns true iff the test part non-fatally failed.
3370 // Returns true iff the test has a non-fatal failure.
3375 // Gets the number of all test parts. This is the sum of the number
3376 // of successful test parts and the number of failed test parts.
3381 // Returns the number of the test properties.
3386 // class Test
3388 // Creates a Test object.
3390 // The c'tor saves the values of all Google Test flags.
3391 Test::Test()
3395 // The d'tor restores the values of all Google Test flags.
3396 Test::~Test() {
3400 // Sets up the test fixture.
3403 void Test::SetUp() {
3406 // Tears down the test fixture.
3409 void Test::TearDown() {
3413 void Test::RecordProperty(const std::string& key, const std::string& value) {
3418 void Test::RecordProperty(const std::string& key, int value) {
3440 // Google Test requires all tests in the same test case to use the same test
3441 // fixture class. This function checks if the current test has the
3442 // same fixture class as the first test in the current test case. If
3443 // yes, it returns true; otherwise it generates a Google Test failure and
3445 bool Test::HasSameFixtureClass() {
3449 // Info about the first test in the current test case.
3454 // Info about the current test.
3460 // Is the first test defined using TEST?
3462 // Is this test defined using TEST?
3466 // The user mixed TEST and TEST_F in this test case - we'll tell
3469 // Gets the name of the TEST and the name of the TEST_F. Note
3478 << "All tests in the same test case must use the same test fixture\n"
3479 << "class, so mixing TEST_F and TEST in the same test case is\n"
3480 << "illegal. In test case " << this_test_info->test_case_name()
3482 << "test " << TEST_F_name << " is defined using TEST_F but\n"
3483 << "test " << TEST_name << " is defined using TEST. You probably\n"
3484 << "want to change the TEST to TEST_F or move it to another test\n"
3490 << "All tests in the same test case must use the same test fixture\n"
3491 << "class. However, in test case "
3493 << "you defined test " << first_test_name
3494 << " and test " << this_test_name << "\n"
3495 << "using two different test fixture classes. This can happen if\n"
3498 << "of the classes to put the tests into different test cases.";
3508 // Adds an "exception thrown" fatal failure to the current test. This
3527 // Adds an "exception thrown" fatal failure to the current test.
3588 // NOTE: The user code can affect the way in which Google Test handles
3595 // // Perform the test method.
3608 // throw statement in the code under test. For this reason, we perform
3609 // the check early, sacrificing the ability to affect Google Test's
3617 // Test assertion with the intention of letting another testing
3640 // Runs the test and updates the test result.
3641 void Test::Run() {
3646 internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");
3647 // We will run the test only if SetUp() was successful.
3651 this, &Test::TestBody, "the test body");
3655 // always call TearDown(), even if SetUp() or the test body has
3659 this, &Test::TearDown, "TearDown()");
3662 // Returns true iff the current test has a fatal failure.
3663 bool Test::HasFatalFailure() {
3667 // Returns true iff the current test has a non-fatal failure.
3668 bool Test::HasNonfatalFailure() {
3675 // Constructs a TestInfo object. It assumes ownership of the test factory
3699 // Creates a new TestInfo object and registers it with Google Test;
3704 // test_case_name: name of the test case
3705 // name: name of the test
3706 // type_param: the name of the test's type parameter, or NULL if
3707 // this is not a typed or a type-parameterized test.
3708 // value_param: text representation of the test's value parameter,
3709 // or NULL if this is not a value-parameterized test.
3710 // fixture_class_id: ID of the test fixture class
3711 // set_up_tc: pointer to the function that sets up the test case
3712 // tear_down_tc: pointer to the function that tears down the test case
3713 // factory: pointer to the factory that creates a test object.
3737 << "Attempted redefinition of test case " << test_case_name << ".\n"
3738 << "All tests in the same test case must use the same test fixture\n"
3739 << "class. However, in test case " << test_case_name << ", you tried\n"
3740 << "to define a test using a fixture class different from the one\n"
3744 << "test cases.";
3755 // A predicate that checks the test name of a TestInfo against a known
3771 // Returns true iff the test name of test_info matches name_.
3798 // Creates the test object, runs it, records its result, and then
3803 // Tells UnitTest where to store test result.
3809 // Notifies the unit test event listeners that a test is about to start.
3816 // Creates the test object.
3817 Test* const test = internal::HandleExceptionsInMethodIfSupported(
3819 "the test fixture's constructor");
3821 // Runs the test only if the test object was created and its
3823 if ((test != NULL) && !Test::HasFatalFailure()) {
3826 test->Run();
3829 // Deletes the test object.
3832 test, &Test::DeleteSelf_, "the test fixture's destructor");
3836 // Notifies the unit test event listener that a test has just finished.
3840 // test.
3846 // Gets the number of successful tests in this test case.
3851 // Gets the number of failed tests in this test case.
3861 // Gets the number of disabled tests in this test case.
3871 // Get the number of tests in this test case that should run.
3885 // name: name of the test case
3886 // a_type_param: the name of the test case's type parameter, or NULL if
3887 // this is not a typed or a type-parameterized test case.
3888 // set_up_tc: pointer to the function that sets up the test case
3889 // tear_down_tc: pointer to the function that tears down the test case
3891 Test::SetUpTestCaseFunc set_up_tc,
3892 Test::TearDownTestCaseFunc tear_down_tc)
3903 // Deletes every Test in the collection.
3907 // Returns the i-th test among all the tests. i can range from 0 to
3914 // Returns the i-th test among all the tests. i can range from 0 to
3921 // Adds a test to this test case. Will delete the test upon
3928 // Runs every test in this TestCase.
3956 // Clears the results of all tests in this test case.
3962 // Shuffles the tests in this test case.
3967 // Restores the test order to before the first shuffle.
3988 return FormatCountableNoun(test_count, "test", "tests");
3991 // Formats the count of test cases.
3993 return FormatCountableNoun(test_case_count, "test case", "test cases");
3999 // between the two when viewing the test result.
4035 // If the test program runs in Visual Studio or a debugger, the
4036 // following statements add the test part result message to the Output
4084 // Returns true iff Google Test should use colors in the output.
4167 // Text printed in Google Test's text output and --gunit_list_tests
4168 // output to label the type parameter and value parameter for a test.
4195 static void PrintTestName(const char * test_case, const char * test) {
4196 printf("%s.%s", test_case, test);
4244 "Note: This is test shard %d of %s.\n",
4265 printf("Global test environment set-up.\n");
4271 FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
4292 // If the test part succeeded, we don't need to do anything.
4324 FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
4335 printf("Global test environment tear-down\n");
4385 num_failures == 1 ? "TEST" : "TESTS");
4396 num_disabled == 1 ? "TEST" : "TESTS");
4398 // Ensure that Google Test output is printed before, e.g., heapchecker output.
4415 // in death test child processes.
4435 // in death test child processes.
4580 // Produces a string representing the test properties in a result as space
4602 // Called after the unit test ends.
4707 // This is how Google Test concepts map to the DTD:
4711 // <testcase name="test-name"> <-- corresponds to a TestInfo object
4905 // Produces a string representing the test properties in a result as space
4926 // arbitrarily long test failure message and stack trace.
4993 // trace stack maintained by Google Test.
5044 // don't want to fail the test because of this.
5170 // Gets the number of successful test cases.
5175 // Gets the number of failed test cases.
5180 // Gets the number of all test cases.
5185 // Gets the number of all test cases that contain at least one test
5220 // Gets the time of the test program start, in ms from the start of the
5231 // Returns true iff the unit test passed (i.e. all test cases passed).
5234 // Returns true iff the unit test failed (i.e. some test case failed
5238 // Gets the i-th test case among all the test cases. i can range from 0 to
5244 // Returns the TestResult containing information on test failures and
5245 // properties logged outside of individual test cases.
5250 // Gets the i-th test case among all the test cases. i can range from 0 to
5257 // inside Google Test.
5262 // Registers and returns a global test environment. When a test
5263 // program is run, all global test environments will be set-up in the
5265 // finished, all global test environments will be torn-down in the
5281 // Adds a TestPartResult to the current TestResult object. All Google Test
5319 // in the code (perhaps in order to use Google Test assertions
5348 // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
5366 // Google Test implements this protocol for catching that a test
5367 // program exits before returning control to Google Test:
5369 // 1. Upon start, Google Test creates a file whose absolute path
5372 // 2. When Google Test has finished its work, it deletes the file.
5374 // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before
5375 // running a Google-Test-based test program and check the existence
5376 // of the file at the end of the test execution to see if it has
5379 // If we are in the child process of a death test, don't
5384 // premature-exit file will be left undeleted, causing a test runner
5386 // test as having failed.
5396 // Either the user wants Google Test to catch exceptions thrown by the
5397 // tests or this is executing in the context of death test child
5408 // Death test children can be terminated with _abort(). On Windows,
5418 // executed. Google Test will notify the user of any unexpected
5437 "auxiliary test code (environments or event listeners)") ? 0 : 1;
5440 // Returns the working directory when the first TEST() or TEST_F() was
5446 // Returns the TestCase object for the test that's currently running,
5447 // or NULL if no test is running.
5454 // Returns the TestInfo object for the test that's currently running,
5455 // or NULL if no test is running.
5462 // Returns the random seed used at the start of the current test run.
5486 // Google Test trace stack.
5493 // Pops a trace from the per-thread Google Test trace stack.
5552 // context of a test, to current test case's ad_hoc_test_result when invoke
5574 // Disables event forwarding if the control is currently in a death test
5597 // Initializes event listeners for streaming test results in string form.
5640 // Configures listeners for streaming test results to the specified server.
5676 // test_case_name: name of the test case
5677 // type_param: the name of the test case's type parameter, or NULL if
5678 // this is not a typed or a type-parameterized test case.
5679 // set_up_tc: pointer to the function that sets up the test case
5680 // tear_down_tc: pointer to the function that tears down the test case
5683 Test::SetUpTestCaseFunc set_up_tc,
5684 Test::TearDownTestCaseFunc tear_down_tc) {
5697 // Is this a death test case?
5700 // Yes. Inserts the test case after the last death test case
5701 // defined so far. This only works when the test cases haven't
5702 // been shuffled. Otherwise we may end up running a death test
5703 // after a non-death test.
5723 // thrown during a test, the test is considered to be failed, but the
5734 "\nThis test program did NOT call ::testing::InitGoogleTest "
5739 // Do not run any test if the --help flag was specified.
5747 // Even if sharding is not on, test runners may want to use the
5748 // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
5753 // death test.
5763 // Compares the full test names with the filter to decide which
5779 // True iff at least one test has failed.
5788 // when we are inside the subprocess of a death test.
5793 // We want to preserve failures generated by ad-hoc test
5799 // Shuffles test cases and tests if requested.
5803 // such that a test event listener can see the actual test order
5808 // Tells the unit test event listeners that the tests are about to start.
5811 // Runs each test case if there is at least one test to run.
5820 if (!Test::HasFatalFailure()) {
5836 // Tells the unit test event listener that the tests have just finished.
5844 // Restores the original test order after the iteration. This
5873 "Could not write to the test shard status file \"%s\" "
5887 // disabled because it must only be applied to the original test
5948 // Given the total number of shards, the shard index, and the test id,
5949 // returns true iff the test should be run on this shard. The test id is
5950 // some arbitrary but unique non-negative integer assigned to each test
5956 // Compares the name of each test with the user-specified filter to
5957 // decide whether the test should be run, then records the result in
5983 // A test is disabled if test case name or test name matches
6106 // Returns the TestResult for the test that's currently running, or
6107 // the TestResult for the ad hoc test if no test is running.
6113 // Shuffles all test cases, and the tests within each test case,
6116 // Shuffles the death test cases.
6119 // Shuffles the non-death test cases.
6123 // Shuffles the tests inside each test case.
6129 // Restores the test cases and tests to their order before the first shuffle.
6132 // Unshuffles the tests in each test case.
6134 // Resets the index of each test case.
6275 // Determines whether a string has a prefix that Google Test uses for its
6277 // If Google Test detects that a command line flag has its prefix but is not
6279 // GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test
6300 // capturing to Google Test.
6339 "Test Selection:\n"
6342 " TEST(Foo, Bar) is \"Foo.Bar\".\n"
6351 "filter@D, but applies to the test's parameter. If a\n"
6352 " test is not parameterized, its parameter is considered to be the\n"
6357 "Test Execution:\n"
6363 " Random number seed to use for shuffling test orders (between 1 and\n"
6366 "Test Output:\n"
6370 " Don't print the elapsed time of each test.\n"
6377 " Stream test results to the given server.\n"
6383 " Set the default death test style.\n"
6390 " Do not report exceptions as test failures. Instead, allow them\n"
6405 // Parses the command line for Google Test flags, without initializing
6406 // other parts of Google Test. The type parameter CharType can be
6418 // Do we see a Google Test flag?
6464 // Both help flag and unrecognized Google Test flags (excluding
6473 // Test with another testing framework.
6478 // Parses the command line for Google Test flags, without initializing
6479 // other parts of Google Test.
6517 // Initializes Google Test. This must be called before calling
6519 // flags that Google Test recognizes. Whenever a Google Test flag is
6522 // No value is returned. Instead, the Google Test flag variables are
6601 // Indicates that this translation unit is part of Google Test's
6613 // The default death test style.
6619 "Indicates how to run a death test in a forked child process: "
6620 "\"threadsafe\" (child process re-executes the test binary "
6621 "from the beginning, running only the specific death test) or "
6622 "\"fast\" (child process runs the death test immediately "
6641 "the single death test to run, and a file descriptor to "
6645 "death test. FOR INTERNAL USE ONLY.");
6653 // child process of a fast style death test.
6659 // executing in the context of the death test child process. Tools such as
6746 // Generates a textual failure message when a death test finds more than
6753 << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
6762 // Flag characters for reporting a death test that did not die.
6768 // An enumeration describing all of the possible ways that a death test can
6769 // conclude. DIED means that the process died while executing the test
6770 // code; LIVED means that process lived beyond the end of the test code;
6771 // RETURNED means that the test statement attempted to execute a return
6772 // statement, which is not allowed; THREW means that the test statement
6773 // returned control by throwing an exception. IN_PROGRESS means the test
6780 // exec-style death test child process, in which case the error
6786 // death test child process, which operates on a very small stack. Use
6841 // This is called from a death test parent process to read a failure
6842 // message from the death test child process and log it with the FATAL
6861 GTEST_LOG_(FATAL) << "Error while reading death test internal: "
6866 // Death test constructor. Increments the running death test count
6867 // for the current test.
6871 DeathTestAbort("Cannot run a death test outside of a TEST or "
6876 // Creates and returns a death test by dispatching to the current
6877 // death test factory.
6879 const char* file, int line, DeathTest** test) {
6881 statement, regex, file, line, test);
6926 // test child process via a pipe, interprets it to set the outcome_
6935 // The regular expression which test output must match. DeathTestImpl
6938 // True if the death test child process has been successfully spawned.
6942 // How the death test concluded.
6955 // test child process via a pipe, interprets it to set the outcome_
6963 // failure of the death test) or until the pipe is closed (signifying
6987 GTEST_LOG_(FATAL) << "Death test child process reported "
6992 GTEST_LOG_(FATAL) << "Read from death test child process failed: "
6999 // Signals that the death test code which should have exited, didn't.
7000 // Should be called only in a death test child process.
7004 // The parent process considers the death test to be a failure if
7023 // Returns an indented copy of stderr output for a death test.
7024 // This makes distinguishing death test output lines from regular log lines
7041 // Assesses the success or failure of a death test, using both private
7045 // outcome: An enumeration describing how the death test
7046 // concluded: DIED, LIVED, THREW, or RETURNED. The death test
7053 // the test's captured standard error output; the death test
7058 // this particular death test, which fails if it is false
7062 // reported. Also sets the last death test message string.
7072 buffer << "Death test: " << statement() << "\n";
7083 buffer << " Result: illegal return in test statement.\n"
7105 << "DeathTest::Passed somehow called before conclusion of test";
7115 // always threadsafe, and Google Test considers the
7136 // determines whether to fail the test.
7154 // The name of the file in which the death test is located.
7156 // The line number on which the death test is located.
7169 // Waits for the child in a death test to exit, returning its exit
7212 // The AssumeRole process for a Windows death test. It creates a child
7214 // death test. The child process is given the --gtest_filter and
7216 // current death test only.
7232 // a death test.
7320 // PID of child process during death test; 0 in the child process itself.
7329 // Waits for the child in a death test to exit, returning its exit
7344 // A concrete death test class that forks, then immediately runs the test
7353 // The AssumeRole process for a fork-and-run death test. It implements a
7371 // there are multiple threads running before the death test, and another
7386 // down in death test subprocesses.
7398 // A concrete death test class that forks and re-executes the main
7400 // only this specific death test to be run.
7413 // The name of the file in which the death test is located.
7415 // The line number on which the death test is located.
7453 // threadsafe-style death test process.
7461 // When Google Test is built as a framework on MacOS X, the environ variable
7474 // The main function for a threadsafe-style death test child process.
7481 // We need to execute the test program in the same environment where
7496 // invoke the test program via a valid path that contains at least
7531 // a thread-safe manner and instructs it to run the death test. The
7547 // We need to execute the test program in the same environment where
7631 // The AssumeRole process for a fork-and-exec death test. It re-executes the
7634 // death test to be re-run.
7685 // by the "test" argument to its address. If the test should be
7690 DeathTest** test) {
7700 "Death test count (" + StreamableToString(death_test_index)
7708 *test = NULL;
7717 *test = new WindowsDeathTest(statement, regex, file, line);
7723 *test = new ExecDeathTest(statement, regex, file, line);
7725 *test = new NoExecDeathTest(statement, regex);
7732 "Unknown death test style \"" + GTEST_FLAG(death_test_style)
8049 // Given directory = "dir", base_name = "test", number = 0,
8050 // extension = "xml", returns "dir/test.xml". If number is greater
8067 // Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".
8316 // Indicates that this translation unit is part of Google Test's
8568 // characters to be indexable by size_t, in which case the test will
8784 // There's no guarantee that a test has write access to the current
9088 // Google Test - The Google C++ Testing Framework
9184 // Returns true if c is a printable ASCII character. We test the
9449 // The Google C++ Testing Framework (Google Test)
9452 // Indicates that this translation unit is part of Google Test's
9571 // Verifies that registered_tests match the test names in
9589 errors << "Test " << name << " is listed more than once.\n";
9606 errors << "No test named " << name
9607 << " can be found in this test case.\n";
9615 errors << "You forgot to list test " << *it << ".\n";