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.
73 // The Google C++ Testing Framework (Google Test)
106 // Utilities for testing Google Test itself and code that uses Google Test
107 // (e.g. frameworks built on top of Google Test).
115 // This helper class can be used to mock out Google Test failure reporting
116 // so that we can test Google Test or code that builds on Google Test.
119 // TestPartResultArray object given in the constructor whenever a Google Test
133 // The c'tor sets this object as the test part result reporter used
134 // by Google Test. The 'result' parameter specifies where to report the
143 // The d'tor restores the previous test part result reporter.
188 // A set of macros for testing Google Test assertions or code that's expected
189 // to generate Google Test fatal failures. It verifies that the given
190 // statement will cause exactly one fatal Google Test failure with 'substr'
209 // works. The AcceptsMacroThatExpandsToUnprotectedComma test in
245 // A macro for testing Google Test assertions or code that's expected to
246 // generate Google Test non-fatal failures. It asserts that the given
247 // statement will cause exactly one non-fatal Google Test failure with 'substr'
269 // AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc
399 // Indicates that this translation unit is part of Google Test's
438 // This file contains purely Google Test's internal implementation. Please
445 // part of Google Test's implementation; otherwise it's undefined.
448 # error "gtest-internal-inl.h is part of Google Test's internal implementation."
449 # error "It must not be included except by Google Test itself."
479 // Google Test's own unit tests to be able to access it. Therefore we
485 // The value of GetTestTypeId() as seen from within the Google Test
489 // Names of the flags (needed for parsing Google Test flags).
515 // Returns true iff Google Test should use colors in the output.
560 // This class saves the values of all Google Test flags in its c'tor, and
660 // disabled because it must only be applied to the original test
671 // Given the total number of shards, the shard index, and the test id,
672 // returns true iff the test should be run on this shard. The test id is
673 // some arbitrary but unique non-negative integer assigned to each test
754 // Returns true iff the test name of test property matches on key_.
770 // test filter using either GTEST_FILTER or --gtest_filter. If both
791 // works well enough for matching test names, which are short.
794 // Returns true iff the user-specified filter matches the test case
795 // name and the test name.
802 // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
831 // UponLeavingGTest() should be called immediately before Google Test calls
833 // CurrentStackTrace() will use to find and hide Google Test stack frames.
851 // Google Test's implementation.
866 // Information about a Google Test trace point.
873 // This is the default global test part result reporter used in UnitTestImpl.
879 // Implements the TestPartResultReporterInterface. Reports the test part
880 // result in the current test.
889 // This is the default per thread test part result reporter used in
896 // delegates to the current global test part result reporter of *unit_test_.
915 // You can register your own repoter to listen either only for test results
917 // By default, each per-thread test result repoter just passes a new
918 // TestPartResult to the global test result reporter, which registers the
919 // test part result for the currently running test.
921 // Returns the global test part result reporter.
924 // Sets the global test part result reporter.
928 // Returns the test part result reporter for the current thread.
931 // Sets the test part result reporter for the current thread.
935 // Gets the number of successful test cases.
938 // Gets the number of failed test cases.
941 // Gets the number of all test cases.
944 // Gets the number of all test cases that contain at least one test
969 // Gets the time of the test program start, in ms from the start of the
976 // Returns true iff the unit test passed (i.e. all test cases passed).
979 // Returns true iff the unit test failed (i.e. some test case failed
985 // Gets the i-th test case among all the test cases. i can range from 0 to
992 // Gets the i-th test case among all the test cases. i can range from 0 to
1002 // Returns the TestResult for the test that's currently running, or
1003 // the TestResult for the ad hoc test if no test is running.
1006 // Returns the TestResult for the ad hoc test.
1038 // test_case_name: name of the test case
1039 // type_param: the name of the test's type parameter, or NULL if
1040 // this is not a typed or a type-parameterized test.
1041 // set_up_tc: pointer to the function that sets up the test case
1042 // tear_down_tc: pointer to the function that tears down the test case
1045 Test::SetUpTestCaseFunc set_up_tc,
1046 Test::TearDownTestCaseFunc tear_down_tc);
1048 // Adds a TestInfo to the unit test.
1052 // set_up_tc: pointer to the function that sets up the test case
1053 // tear_down_tc: pointer to the function that tears down the test case
1055 void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
1056 Test::TearDownTestCaseFunc tear_down_tc,
1059 // remember the original working directory when the test program
1063 // AddTestInfo(), which is called to register a TEST or TEST_F
1085 // Sets the TestCase object for the test that's currently running.
1090 // Sets the TestInfo object for the test that's currently running. If
1098 // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter
1107 // thrown during a test, this test is considered to be failed, but
1116 // Clears the results of ad-hoc test assertions.
1122 // context of a test or a test case, or to the global property set. If the
1132 // Matches the full name of each test against the user-specified
1133 // filter to decide whether the test should run, then records the
1151 // Getters for the per-thread Google Test trace stack.
1165 // This information is useful only in a death test child process.
1171 // Returns a pointer to the current death test factory.
1186 // Initializes the event listener for streaming test results to a socket.
1198 // Gets the random seed used at the start of the current test iteration.
1204 // Shuffles all test cases, and the tests within each test case,
1208 // Restores the test cases and tests to their order before the first shuffle.
1225 // The working directory when the first TEST() or TEST_F() was
1229 // The default test part result reporters.
1234 // Points to (but doesn't own) the global test part result reporter.
1240 // Points to (but doesn't own) the per-thread test part result reporter.
1252 // Provides a level of indirection for the test case list to allow
1253 // easy shuffling and restoring the test case order. The i-th
1254 // element of this vector is the index of the i-th test case in the
1267 // Index of the last death test case registered. Initially -1.
1270 // This points to the TestCase for the currently running test. It
1271 // changes as Google Test goes through one test case after another.
1272 // When no test is running, this is set to NULL and Google Test
1276 // This points to the TestInfo for the currently running test. It
1277 // changes as Google Test goes through one test after another. When
1278 // no test is running, this is set to NULL and Google Test stores
1282 // Normally, a user only writes assertions inside a TEST or TEST_F,
1283 // or inside a function called by a TEST or TEST_F. Since Google
1284 // Test keeps track of which test is current running, it can
1285 // associate such an assertion with the test it belongs to.
1287 // If an assertion is encountered when no TEST or TEST_F is running,
1288 // Google Test attributes the assertion result to an imaginary "ad hoc"
1289 // test, and records the result in ad_hoc_test_result_.
1293 // Google Test.
1305 // The random number seed used at the beginning of the test run.
1311 // The time of the test program start, in ms from the start of the
1315 // How long the test took to run, in milliseconds.
1361 // Parses the command line for Google Test flags, without initializing
1362 // other parts of Google Test.
1445 // Google Test user but are required for testing. This class allow our tests
1448 // This class is supplied only for the purpose of testing Google Test's own
1470 // Streams test results to the given port on the given host machine.
1550 // Note that Google Test current only report elapsed time for each
1551 // test iteration, not for the entire test program.
1635 // A test whose test case name or test name matches this filter is
1639 // A test case whose name matches this filter is considered a death
1640 // test case and will be run before test cases whose name doesn't
1644 // A test filter that matches everything.
1650 // The environment variable name for the test shard index.
1652 // The environment variable name for the total number of test shards.
1654 // The environment variable name for the test shard status file.
1687 " should catch exceptions and treat them as test failures.");
1703 "exclude). A test is run if it matches one of the positive "
1717 "within that directory, with file-names based on the test "
1730 "Random number seed to use when shuffling test orders. Must be in range "
1736 "How many times to repeat each test. Specify a negative number "
1742 "printing test failure stack traces.");
1760 "test results. Example: \"localhost:555\". The flag is effective only on "
1792 // Google Test. Useful for catching the user mistake of not initializing
1793 // Google Test before calling RUN_ALL_TESTS().
1796 // Test. g_init_gtest_count is set to the number of times
1814 // Returns true iff the test case passed.
1819 // Returns true iff the test case failed.
1824 // Returns true iff test_case contains at least one test that should
1923 // works well enough for matching test names, which are short.
1962 // Returns true iff the user-specified filter matches the test case
1963 // name and the test name.
1987 // test if any pattern in it matches the test.
1993 // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
1997 // Google Test should handle a SEH exception if:
2022 // The c'tor sets this object as the test part result reporter used by
2023 // Google Test. The 'result' parameter specifies where to report the
2032 // The c'tor sets this object as the test part result reporter used by
2033 // Google Test. The 'result' parameter specifies where to report the
2053 // The d'tor restores the test part result reporter used by Google Test
2064 // Increments the test part result count and remembers the result.
2073 // Returns the type ID of ::testing::Test. We should always call this
2074 // instead of GetTypeId< ::testing::Test>() to get the type ID of
2075 // testing::Test. This is to work around a suspected linker bug when
2076 // using Google Test as a framework on Mac OS X. The bug causes
2077 // GetTypeId< ::testing::Test>() to return different values depending
2078 // on whether the call is from the Google Test framework itself or
2079 // from user test code. GetTestTypeId() is guaranteed to always
2081 // gtest.cc, which is within the Google Test framework.
2083 return GetTypeId<Test>();
2086 // The value of GetTestTypeId() as seen from within the Google Test
2090 // This predicate-formatter checks that 'results' contains a test part
2130 // test part results, what type of failure we expect, and what
2165 // Returns the global test part result reporter.
2172 // Sets the global test part result reporter.
2179 // Returns the test part result reporter for the current thread.
2185 // Sets the test part result reporter for the current thread.
2191 // Gets the number of successful test cases.
2196 // Gets the number of failed test cases.
2201 // Gets the number of all test cases.
2206 // Gets the number of all test cases that contain at least one test
3161 // Appends the user-supplied message to the Google-Test-generated message.
3187 // Returns the i-th test part result among all the results. i can
3196 // Returns the i-th test property. i can range from 0 to
3205 // Clears the test part results.
3210 // Adds a test part result to the list.
3215 // Adds a test property to the list. If a property with the same key as the
3330 // Returns true iff the test failed.
3339 // Returns true iff the test part fatally failed.
3344 // Returns true iff the test fatally failed.
3349 // Returns true iff the test part non-fatally failed.
3354 // Returns true iff the test has a non-fatal failure.
3359 // Gets the number of all test parts. This is the sum of the number
3360 // of successful test parts and the number of failed test parts.
3365 // Returns the number of the test properties.
3370 // class Test
3372 // Creates a Test object.
3374 // The c'tor saves the values of all Google Test flags.
3375 Test::Test()
3379 // The d'tor restores the values of all Google Test flags.
3380 Test::~Test() {
3384 // Sets up the test fixture.
3387 void Test::SetUp() {
3390 // Tears down the test fixture.
3393 void Test::TearDown() {
3397 void Test::RecordProperty(const std::string& key, const std::string& value) {
3402 void Test::RecordProperty(const std::string& key, int value) {
3424 // Google Test requires all tests in the same test case to use the same test
3425 // fixture class. This function checks if the current test has the
3426 // same fixture class as the first test in the current test case. If
3427 // yes, it returns true; otherwise it generates a Google Test failure and
3429 bool Test::HasSameFixtureClass() {
3433 // Info about the first test in the current test case.
3438 // Info about the current test.
3444 // Is the first test defined using TEST?
3446 // Is this test defined using TEST?
3450 // The user mixed TEST and TEST_F in this test case - we'll tell
3453 // Gets the name of the TEST and the name of the TEST_F. Note
3462 << "All tests in the same test case must use the same test fixture\n"
3463 << "class, so mixing TEST_F and TEST in the same test case is\n"
3464 << "illegal. In test case " << this_test_info->test_case_name()
3466 << "test " << TEST_F_name << " is defined using TEST_F but\n"
3467 << "test " << TEST_name << " is defined using TEST. You probably\n"
3468 << "want to change the TEST to TEST_F or move it to another test\n"
3474 << "All tests in the same test case must use the same test fixture\n"
3475 << "class. However, in test case "
3477 << "you defined test " << first_test_name
3478 << " and test " << this_test_name << "\n"
3479 << "using two different test fixture classes. This can happen if\n"
3482 << "of the classes to put the tests into different test cases.";
3492 // Adds an "exception thrown" fatal failure to the current test. This
3511 // Adds an "exception thrown" fatal failure to the current test.
3572 // NOTE: The user code can affect the way in which Google Test handles
3579 // // Perform the test method.
3592 // throw statement in the code under test. For this reason, we perform
3593 // the check early, sacrificing the ability to affect Google Test's
3601 // Test assertion with the intention of letting another testing
3624 // Runs the test and updates the test result.
3625 void Test::Run() {
3630 internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");
3631 // We will run the test only if SetUp() was successful.
3635 this, &Test::TestBody, "the test body");
3639 // always call TearDown(), even if SetUp() or the test body has
3643 this, &Test::TearDown, "TearDown()");
3646 // Returns true iff the current test has a fatal failure.
3647 bool Test::HasFatalFailure() {
3651 // Returns true iff the current test has a non-fatal failure.
3652 bool Test::HasNonfatalFailure() {
3659 // Constructs a TestInfo object. It assumes ownership of the test factory
3683 // Creates a new TestInfo object and registers it with Google Test;
3688 // test_case_name: name of the test case
3689 // name: name of the test
3690 // type_param: the name of the test's type parameter, or NULL if
3691 // this is not a typed or a type-parameterized test.
3692 // value_param: text representation of the test's value parameter,
3693 // or NULL if this is not a value-parameterized test.
3694 // fixture_class_id: ID of the test fixture class
3695 // set_up_tc: pointer to the function that sets up the test case
3696 // tear_down_tc: pointer to the function that tears down the test case
3697 // factory: pointer to the factory that creates a test object.
3721 << "Attempted redefinition of test case " << test_case_name << ".\n"
3722 << "All tests in the same test case must use the same test fixture\n"
3723 << "class. However, in test case " << test_case_name << ", you tried\n"
3724 << "to define a test using a fixture class different from the one\n"
3728 << "test cases.";
3739 // A predicate that checks the test name of a TestInfo against a known
3755 // Returns true iff the test name of test_info matches name_.
3782 // Creates the test object, runs it, records its result, and then
3787 // Tells UnitTest where to store test result.
3793 // Notifies the unit test event listeners that a test is about to start.
3800 // Creates the test object.
3801 Test* const test = internal::HandleExceptionsInMethodIfSupported(
3803 "the test fixture's constructor");
3805 // Runs the test only if the test object was created and its
3807 if ((test != NULL) && !Test::HasFatalFailure()) {
3810 test->Run();
3813 // Deletes the test object.
3816 test, &Test::DeleteSelf_, "the test fixture's destructor");
3820 // Notifies the unit test event listener that a test has just finished.
3824 // test.
3830 // Gets the number of successful tests in this test case.
3835 // Gets the number of failed tests in this test case.
3845 // Gets the number of disabled tests in this test case.
3855 // Get the number of tests in this test case that should run.
3869 // name: name of the test case
3870 // a_type_param: the name of the test case's type parameter, or NULL if
3871 // this is not a typed or a type-parameterized test case.
3872 // set_up_tc: pointer to the function that sets up the test case
3873 // tear_down_tc: pointer to the function that tears down the test case
3875 Test::SetUpTestCaseFunc set_up_tc,
3876 Test::TearDownTestCaseFunc tear_down_tc)
3887 // Deletes every Test in the collection.
3891 // Returns the i-th test among all the tests. i can range from 0 to
3898 // Returns the i-th test among all the tests. i can range from 0 to
3905 // Adds a test to this test case. Will delete the test upon
3912 // Runs every test in this TestCase.
3940 // Clears the results of all tests in this test case.
3946 // Shuffles the tests in this test case.
3951 // Restores the test order to before the first shuffle.
3972 return FormatCountableNoun(test_count, "test", "tests");
3975 // Formats the count of test cases.
3977 return FormatCountableNoun(test_case_count, "test case", "test cases");
3983 // between the two when viewing the test result.
4019 // If the test program runs in Visual Studio or a debugger, the
4020 // following statements add the test part result message to the Output
4068 // Returns true iff Google Test should use colors in the output.
4151 // Text printed in Google Test's text output and --gunit_list_tests
4152 // output to label the type parameter and value parameter for a test.
4179 static void PrintTestName(const char * test_case, const char * test) {
4180 printf("%s.%s", test_case, test);
4220 "Note: This is test shard %d of %s.\n",
4241 printf("Global test environment set-up.\n");
4247 FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
4268 // If the test part succeeded, we don't need to do anything.
4300 FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
4311 printf("Global test environment tear-down\n");
4361 num_failures == 1 ? "TEST" : "TESTS");
4372 num_disabled == 1 ? "TEST" : "TESTS");
4374 // Ensure that Google Test output is printed before, e.g., heapchecker output.
4391 // in death test child processes.
4411 // in death test child processes.
4556 // Produces a string representing the test properties in a result as space
4578 // Called after the unit test ends.
4683 // This is how Google Test concepts map to the DTD:
4687 // <testcase name="test-name"> <-- corresponds to a TestInfo object
4881 // Produces a string representing the test properties in a result as space
4902 // arbitrarily long test failure message and stack trace.
4969 // trace stack maintained by Google Test.
5020 // don't want to fail the test because of this.
5146 // Gets the number of successful test cases.
5151 // Gets the number of failed test cases.
5156 // Gets the number of all test cases.
5161 // Gets the number of all test cases that contain at least one test
5196 // Gets the time of the test program start, in ms from the start of the
5207 // Returns true iff the unit test passed (i.e. all test cases passed).
5210 // Returns true iff the unit test failed (i.e. some test case failed
5214 // Gets the i-th test case among all the test cases. i can range from 0 to
5220 // Returns the TestResult containing information on test failures and
5221 // properties logged outside of individual test cases.
5226 // Gets the i-th test case among all the test cases. i can range from 0 to
5233 // inside Google Test.
5238 // Registers and returns a global test environment. When a test
5239 // program is run, all global test environments will be set-up in the
5241 // finished, all global test environments will be torn-down in the
5257 // Adds a TestPartResult to the current TestResult object. All Google Test
5295 // in the code (perhaps in order to use Google Test assertions
5324 // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
5342 // Google Test implements this protocol for catching that a test
5343 // program exits before returning control to Google Test:
5345 // 1. Upon start, Google Test creates a file whose absolute path
5348 // 2. When Google Test has finished its work, it deletes the file.
5350 // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before
5351 // running a Google-Test-based test program and check the existence
5352 // of the file at the end of the test execution to see if it has
5355 // If we are in the child process of a death test, don't
5360 // premature-exit file will be left undeleted, causing a test runner
5362 // test as having failed.
5372 // Either the user wants Google Test to catch exceptions thrown by the
5373 // tests or this is executing in the context of death test child
5384 // Death test children can be terminated with _abort(). On Windows,
5394 // executed. Google Test will notify the user of any unexpected
5413 "auxiliary test code (environments or event listeners)") ? 0 : 1;
5416 // Returns the working directory when the first TEST() or TEST_F() was
5422 // Returns the TestCase object for the test that's currently running,
5423 // or NULL if no test is running.
5430 // Returns the TestInfo object for the test that's currently running,
5431 // or NULL if no test is running.
5438 // Returns the random seed used at the start of the current test run.
5462 // Google Test trace stack.
5469 // Pops a trace from the per-thread Google Test trace stack.
5528 // context of a test, to current test case's ad_hoc_test_result when invoke
5550 // Disables event forwarding if the control is currently in a death test
5573 // Initializes event listeners for streaming test results in string form.
5616 // Configures listeners for streaming test results to the specified server.
5652 // test_case_name: name of the test case
5653 // type_param: the name of the test case's type parameter, or NULL if
5654 // this is not a typed or a type-parameterized test case.
5655 // set_up_tc: pointer to the function that sets up the test case
5656 // tear_down_tc: pointer to the function that tears down the test case
5659 Test::SetUpTestCaseFunc set_up_tc,
5660 Test::TearDownTestCaseFunc tear_down_tc) {
5673 // Is this a death test case?
5676 // Yes. Inserts the test case after the last death test case
5677 // defined so far. This only works when the test cases haven't
5678 // been shuffled. Otherwise we may end up running a death test
5679 // after a non-death test.
5699 // thrown during a test, the test is considered to be failed, but the
5710 "\nThis test program did NOT call ::testing::InitGoogleTest "
5715 // Do not run any test if the --help flag was specified.
5723 // Even if sharding is not on, test runners may want to use the
5724 // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
5729 // death test.
5739 // Compares the full test names with the filter to decide which
5755 // True iff at least one test has failed.
5764 // when we are inside the subprocess of a death test.
5769 // We want to preserve failures generated by ad-hoc test
5775 // Shuffles test cases and tests if requested.
5779 // such that a test event listener can see the actual test order
5784 // Tells the unit test event listeners that the tests are about to start.
5787 // Runs each test case if there is at least one test to run.
5796 if (!Test::HasFatalFailure()) {
5812 // Tells the unit test event listener that the tests have just finished.
5820 // Restores the original test order after the iteration. This
5849 "Could not write to the test shard status file \"%s\" "
5863 // disabled because it must only be applied to the original test
5924 // Given the total number of shards, the shard index, and the test id,
5925 // returns true iff the test should be run on this shard. The test id is
5926 // some arbitrary but unique non-negative integer assigned to each test
5932 // Compares the name of each test with the user-specified filter to
5933 // decide whether the test should be run, then records the result in
5959 // A test is disabled if test case name or test name matches
6076 // Returns the TestResult for the test that's currently running, or
6077 // the TestResult for the ad hoc test if no test is running.
6083 // Shuffles all test cases, and the tests within each test case,
6086 // Shuffles the death test cases.
6089 // Shuffles the non-death test cases.
6093 // Shuffles the tests inside each test case.
6099 // Restores the test cases and tests to their order before the first shuffle.
6102 // Unshuffles the tests in each test case.
6104 // Resets the index of each test case.
6245 // Determines whether a string has a prefix that Google Test uses for its
6247 // If Google Test detects that a command line flag has its prefix but is not
6249 // GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test
6270 // capturing to Google Test.
6309 "Test Selection:\n"
6312 " TEST(Foo, Bar) is \"Foo.Bar\".\n"
6321 "Test Execution:\n"
6327 " Random number seed to use for shuffling test orders (between 1 and\n"
6330 "Test Output:\n"
6334 " Don't print the elapsed time of each test.\n"
6341 " Stream test results to the given server.\n"
6347 " Set the default death test style.\n"
6354 " Do not report exceptions as test failures. Instead, allow them\n"
6369 // Parses the command line for Google Test flags, without initializing
6370 // other parts of Google Test. The type parameter CharType can be
6382 // Do we see a Google Test flag?
6427 // Both help flag and unrecognized Google Test flags (excluding
6436 // Test with another testing framework.
6441 // Parses the command line for Google Test flags, without initializing
6442 // other parts of Google Test.
6480 // Initializes Google Test. This must be called before calling
6482 // flags that Google Test recognizes. Whenever a Google Test flag is
6485 // No value is returned. Instead, the Google Test flag variables are
6564 // Indicates that this translation unit is part of Google Test's
6576 // The default death test style.
6582 "Indicates how to run a death test in a forked child process: "
6583 "\"threadsafe\" (child process re-executes the test binary "
6584 "from the beginning, running only the specific death test) or "
6585 "\"fast\" (child process runs the death test immediately "
6604 "the single death test to run, and a file descriptor to "
6608 "death test. FOR INTERNAL USE ONLY.");
6616 // child process of a fast style death test.
6620 // executing in the context of the death test child process. Tools such as
6707 // Generates a textual failure message when a death test finds more than
6714 << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
6723 // Flag characters for reporting a death test that did not die.
6729 // An enumeration describing all of the possible ways that a death test can
6730 // conclude. DIED means that the process died while executing the test
6731 // code; LIVED means that process lived beyond the end of the test code;
6732 // RETURNED means that the test statement attempted to execute a return
6733 // statement, which is not allowed; THREW means that the test statement
6734 // returned control by throwing an exception. IN_PROGRESS means the test
6741 // exec-style death test child process, in which case the error
6747 // death test child process, which operates on a very small stack. Use
6802 // This is called from a death test parent process to read a failure
6803 // message from the death test child process and log it with the FATAL
6822 GTEST_LOG_(FATAL) << "Error while reading death test internal: "
6827 // Death test constructor. Increments the running death test count
6828 // for the current test.
6832 DeathTestAbort("Cannot run a death test outside of a TEST or "
6837 // Creates and returns a death test by dispatching to the current
6838 // death test factory.
6840 const char* file, int line, DeathTest** test) {
6842 statement, regex, file, line, test);
6887 // test child process via a pipe, interprets it to set the outcome_
6896 // The regular expression which test output must match. DeathTestImpl
6899 // True if the death test child process has been successfully spawned.
6903 // How the death test concluded.
6916 // test child process via a pipe, interprets it to set the outcome_
6924 // failure of the death test) or until the pipe is closed (signifying
6948 GTEST_LOG_(FATAL) << "Death test child process reported "
6953 GTEST_LOG_(FATAL) << "Read from death test child process failed: "
6960 // Signals that the death test code which should have exited, didn't.
6961 // Should be called only in a death test child process.
6965 // The parent process considers the death test to be a failure if
6984 // Returns an indented copy of stderr output for a death test.
6985 // This makes distinguishing death test output lines from regular log lines
7002 // Assesses the success or failure of a death test, using both private
7006 // outcome: An enumeration describing how the death test
7007 // concluded: DIED, LIVED, THREW, or RETURNED. The death test
7014 // the test's captured standard error output; the death test
7019 // this particular death test, which fails if it is false
7023 // reported. Also sets the last death test message string.
7033 buffer << "Death test: " << statement() << "\n";
7044 buffer << " Result: illegal return in test statement.\n"
7066 << "DeathTest::Passed somehow called before conclusion of test";
7076 // always threadsafe, and Google Test considers the
7097 // determines whether to fail the test.
7115 // The name of the file in which the death test is located.
7117 // The line number on which the death test is located.
7130 // Waits for the child in a death test to exit, returning its exit
7173 // The AssumeRole process for a Windows death test. It creates a child
7175 // death test. The child process is given the --gtest_filter and
7177 // current death test only.
7193 // a death test.
7281 // PID of child process during death test; 0 in the child process itself.
7290 // Waits for the child in a death test to exit, returning its exit
7305 // A concrete death test class that forks, then immediately runs the test
7314 // The AssumeRole process for a fork-and-run death test. It implements a
7332 // there are multiple threads running before the death test, and another
7347 // down in death test subprocesses.
7359 // A concrete death test class that forks and re-executes the main
7361 // only this specific death test to be run.
7374 // The name of the file in which the death test is located.
7376 // The line number on which the death test is located.
7414 // threadsafe-style death test process.
7422 // When Google Test is built as a framework on MacOS X, the environ variable
7435 // The main function for a threadsafe-style death test child process.
7442 // We need to execute the test program in the same environment where
7457 // invoke the test program via a valid path that contains at least
7490 // a thread-safe manner and instructs it to run the death test. The
7506 // We need to execute the test program in the same environment where
7590 // The AssumeRole process for a fork-and-exec death test. It re-executes the
7593 // death test to be re-run.
7644 // by the "test" argument to its address. If the test should be
7649 DeathTest** test) {
7659 "Death test count (" + StreamableToString(death_test_index)
7667 *test = NULL;
7676 *test = new WindowsDeathTest(statement, regex, file, line);
7682 *test = new ExecDeathTest(statement, regex, file, line);
7684 *test = new NoExecDeathTest(statement, regex);
7691 "Unknown death test style \"" + GTEST_FLAG(death_test_style)
8008 // Given directory = "dir", base_name = "test", number = 0,
8009 // extension = "xml", returns "dir/test.xml". If number is greater
8026 // Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".
8275 // Indicates that this translation unit is part of Google Test's
8527 // characters to be indexable by size_t, in which case the test will
8743 // There's no guarantee that a test has write access to the current
9047 // Google Test - The Google C++ Testing Framework
9143 // Returns true if c is a printable ASCII character. We test the
9408 // The Google C++ Testing Framework (Google Test)
9411 // Indicates that this translation unit is part of Google Test's
9530 // Verifies that registered_tests match the test names in
9548 errors << "Test " << name << " is listed more than once.\n";
9565 errors << "No test named " << name
9566 << " can be found in this test case.\n";
9574 errors << "You forgot to list test " << *it << ".\n";