Home | History | Annotate | Download | only in gtest

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
405 // Indicates that this translation unit is part of Google Test's
444 // This file contains purely Google Test's internal implementation. Please
451 // part of Google Test's implementation; otherwise it's undefined.
454 # error "gtest-internal-inl.h is part of Google Test's internal implementation."
455 # error "It must not be included except by Google Test itself."
485 // Google Test's own unit tests to be able to access it. Therefore we
491 // The value of GetTestTypeId() as seen from within the Google Test
495 // Names of the flags (needed for parsing Google Test flags).
522 // Returns true iff Google Test should use colors in the output.
567 // This class saves the values of all Google Test flags in its c'tor, and
667 // disabled because it must only be applied to the original test
678 // Given the total number of shards, the shard index, and the test id,
679 // returns true iff the test should be run on this shard. The test id is
680 // some arbitrary but unique non-negative integer assigned to each test
761 // Returns true iff the test name of test property matches on key_.
777 // test filter using either GTEST_FILTER or --gtest_filter. If both
798 // works well enough for matching test names, which are short.
801 // Returns true iff the user-specified filter matches the test case
802 // name and the test name.
809 // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
838 // UponLeavingGTest() should be called immediately before Google Test calls
840 // CurrentStackTrace() will use to find and hide Google Test stack frames.
844 // Google Test's implementation.
863 // Information about a Google Test trace point.
870 // This is the default global test part result reporter used in UnitTestImpl.
876 // Implements the TestPartResultReporterInterface. Reports the test part
877 // result in the current test.
886 // This is the default per thread test part result reporter used in
893 // delegates to the current global test part result reporter of *unit_test_.
912 // You can register your own repoter to listen either only for test results
914 // By default, each per-thread test result repoter just passes a new
915 // TestPartResult to the global test result reporter, which registers the
916 // test part result for the currently running test.
918 // Returns the global test part result reporter.
921 // Sets the global test part result reporter.
925 // Returns the test part result reporter for the current thread.
928 // Sets the test part result reporter for the current thread.
932 // Gets the number of successful test cases.
935 // Gets the number of failed test cases.
938 // Gets the number of all test cases.
941 // Gets the number of all test cases that contain at least one test
966 // Gets the time of the test program start, in ms from the start of the
973 // Returns true iff the unit test passed (i.e. all test cases passed).
976 // Returns true iff the unit test failed (i.e. some test case failed
982 // Gets the i-th test case among all the test cases. i can range from 0 to
989 // Gets the i-th test case among all the test cases. i can range from 0 to
999 // Returns the TestResult for the test that's currently running, or
1000 // the TestResult for the ad hoc test if no test is running.
1003 // Returns the TestResult for the ad hoc test.
1035 // test_case_name: name of the test case
1036 // type_param: the name of the test's type parameter, or NULL if
1037 // this is not a typed or a type-parameterized test.
1038 // set_up_tc: pointer to the function that sets up the test case
1039 // tear_down_tc: pointer to the function that tears down the test case
1042 Test::SetUpTestCaseFunc set_up_tc,
1043 Test::TearDownTestCaseFunc tear_down_tc);
1045 // Adds a TestInfo to the unit test.
1049 // set_up_tc: pointer to the function that sets up the test case
1050 // tear_down_tc: pointer to the function that tears down the test case
1052 void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
1053 Test::TearDownTestCaseFunc tear_down_tc,
1056 // remember the original working directory when the test program
1060 // AddTestInfo(), which is called to register a TEST or TEST_F
1082 // Sets the TestCase object for the test that's currently running.
1087 // Sets the TestInfo object for the test that's currently running. If
1095 // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter
1104 // thrown during a test, this test is considered to be failed, but
1113 // Clears the results of ad-hoc test assertions.
1119 // context of a test or a test case, or to the global property set. If the
1129 // Matches the full name of each test against the user-specified
1130 // filter to decide whether the test should run, then records the
1148 // Getters for the per-thread Google Test trace stack.
1162 // This information is useful only in a death test child process.
1168 // Returns a pointer to the current death test factory.
1183 // Initializes the event listener for streaming test results to a socket.
1195 // Gets the random seed used at the start of the current test iteration.
1201 // Shuffles all test cases, and the tests within each test case,
1205 // Restores the test cases and tests to their order before the first shuffle.
1222 // The working directory when the first TEST() or TEST_F() was
1226 // The default test part result reporters.
1231 // Points to (but doesn't own) the global test part result reporter.
1237 // Points to (but doesn't own) the per-thread test part result reporter.
1249 // Provides a level of indirection for the test case list to allow
1250 // easy shuffling and restoring the test case order. The i-th
1251 // element of this vector is the index of the i-th test case in the
1264 // Index of the last death test case registered. Initially -1.
1267 // This points to the TestCase for the currently running test. It
1268 // changes as Google Test goes through one test case after another.
1269 // When no test is running, this is set to NULL and Google Test
1273 // This points to the TestInfo for the currently running test. It
1274 // changes as Google Test goes through one test after another. When
1275 // no test is running, this is set to NULL and Google Test stores
1279 // Normally, a user only writes assertions inside a TEST or TEST_F,
1280 // or inside a function called by a TEST or TEST_F. Since Google
1281 // Test keeps track of which test is current running, it can
1282 // associate such an assertion with the test it belongs to.
1284 // If an assertion is encountered when no TEST or TEST_F is running,
1285 // Google Test attributes the assertion result to an imaginary "ad hoc"
1286 // test, and records the result in ad_hoc_test_result_.
1290 // Google Test.
1302 // The random number seed used at the beginning of the test run.
1308 // The time of the test program start, in ms from the start of the
1312 // How long the test took to run, in milliseconds.
1358 // Parses the command line for Google Test flags, without initializing
1359 // other parts of Google Test.
1416 // Google Test user but are required for testing. This class allow our tests
1419 // This class is supplied only for the purpose of testing Google Test's own
1441 // Streams test results to the given port on the given host machine.
1521 // Note that Google Test current only report elapsed time for each
1522 // test iteration, not for the entire test program.
1606 // A test whose test case name or test name matches this filter is
1610 // A test case whose name matches this filter is considered a death
1611 // test case and will be run before test cases whose name doesn't
1615 // A test filter that matches everything.
1621 // The environment variable name for the test shard index.
1623 // The environment variable name for the total number of test shards.
1625 // The environment variable name for the test shard status file.
1664 " should catch exceptions and treat them as test failures.");
1680 "exclude). A test is run if it matches one of the positive "
1694 "within that directory, with file-names based on the test "
1707 "Random number seed to use when shuffling test orders. Must be in range "
1713 "How many times to repeat each test. Specify a negative number "
1719 "printing test failure stack traces.");
1737 "test results. Example: \"localhost:555\". The flag is effective only on "
1776 // Google Test. Useful for catching the user mistake of not initializing
1777 // Google Test before calling RUN_ALL_TESTS().
1792 // Returns true iff the test case passed.
1797 // Returns true iff the test case failed.
1802 // Returns true iff test_case contains at least one test that should
1909 // works well enough for matching test names, which are short.
1948 // Returns true iff the user-specified filter matches the test case
1949 // name and the test name.
1973 // test if any pattern in it matches the test.
1979 // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
1983 // Google Test should handle a SEH exception if:
2008 // The c'tor sets this object as the test part result reporter used by
2009 // Google Test. The 'result' parameter specifies where to report the
2018 // The c'tor sets this object as the test part result reporter used by
2019 // Google Test. The 'result' parameter specifies where to report the
2039 // The d'tor restores the test part result reporter used by Google Test
2050 // Increments the test part result count and remembers the result.
2059 // Returns the type ID of ::testing::Test. We should always call this
2060 // instead of GetTypeId< ::testing::Test>() to get the type ID of
2061 // testing::Test. This is to work around a suspected linker bug when
2062 // using Google Test as a framework on Mac OS X. The bug causes
2063 // GetTypeId< ::testing::Test>() to return different values depending
2064 // on whether the call is from the Google Test framework itself or
2065 // from user test code. GetTestTypeId() is guaranteed to always
2067 // gtest.cc, which is within the Google Test framework.
2069 return GetTypeId<Test>();
2072 // The value of GetTestTypeId() as seen from within the Google Test
2076 // This predicate-formatter checks that 'results' contains a test part
2116 // test part results, what type of failure we expect, and what
2151 // Returns the global test part result reporter.
2158 // Sets the global test part result reporter.
2165 // Returns the test part result reporter for the current thread.
2171 // Sets the test part result reporter for the current thread.
2177 // Gets the number of successful test cases.
2182 // Gets the number of failed test cases.
2187 // Gets the number of all test cases.
2192 // Gets the number of all test cases that contain at least one test
3448 // Appends the user-supplied message to the Google-Test-generated message.
3474 // Returns the i-th test part result among all the results. i can
3483 // Returns the i-th test property. i can range from 0 to
3492 // Clears the test part results.
3497 // Adds a test part result to the list.
3502 // Adds a test property to the list. If a property with the same key as the
3617 // Returns true iff the test failed.
3626 // Returns true iff the test part fatally failed.
3631 // Returns true iff the test fatally failed.
3636 // Returns true iff the test part non-fatally failed.
3641 // Returns true iff the test has a non-fatal failure.
3646 // Gets the number of all test parts. This is the sum of the number
3647 // of successful test parts and the number of failed test parts.
3652 // Returns the number of the test properties.
3657 // class Test
3659 // Creates a Test object.
3662 Test::Test()
3669 Test::~Test() {
3672 // Sets up the test fixture.
3675 void Test::SetUp() {
3678 // Tears down the test fixture.
3681 void Test::TearDown() {
3685 void Test::RecordProperty(const std::string& key, const std::string& value) {
3690 void Test::RecordProperty(const std::string& key, int value) {
3712 // Google Test requires all tests in the same test case to use the same test
3713 // fixture class. This function checks if the current test has the
3714 // same fixture class as the first test in the current test case. If
3715 // yes, it returns true; otherwise it generates a Google Test failure and
3717 bool Test::HasSameFixtureClass() {
3721 // Info about the first test in the current test case.
3726 // Info about the current test.
3732 // Is the first test defined using TEST?
3734 // Is this test defined using TEST?
3738 // Both TEST and TEST_F appear in same test case, which is incorrect.
3741 // Gets the name of the TEST and the name of the TEST_F. Note
3750 << "All tests in the same test case must use the same test fixture\n"
3751 << "class, so mixing TEST_F and TEST in the same test case is\n"
3752 << "illegal. In test case " << this_test_info->test_case_name()
3754 << "test " << TEST_F_name << " is defined using TEST_F but\n"
3755 << "test " << TEST_name << " is defined using TEST. You probably\n"
3756 << "want to change the TEST to TEST_F or move it to another test\n"
3762 << "All tests in the same test case must use the same test fixture\n"
3763 << "class. However, in test case "
3765 << "you defined test " << first_test_name
3766 << " and test " << this_test_name << "\n"
3767 << "using two different test fixture classes. This can happen if\n"
3770 << "of the classes to put the tests into different test cases.";
3780 // Adds an "exception thrown" fatal failure to the current test. This
3799 // Adds an "exception thrown" fatal failure to the current test.
3860 // NOTE: The user code can affect the way in which Google Test handles
3867 // // Perform the test method.
3880 // throw statement in the code under test. For this reason, we perform
3881 // the check early, sacrificing the ability to affect Google Test's
3889 // Test assertion with the intention of letting another testing
3912 // Runs the test and updates the test result.
3913 void Test::Run() {
3918 internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");
3919 // We will run the test only if SetUp() was successful.
3923 this, &Test::TestBody, "the test body");
3927 // always call TearDown(), even if SetUp() or the test body has
3931 this, &Test::TearDown, "TearDown()");
3934 // Returns true iff the current test has a fatal failure.
3935 bool Test::HasFatalFailure() {
3939 // Returns true iff the current test has a non-fatal failure.
3940 bool Test::HasNonfatalFailure() {
3947 // Constructs a TestInfo object. It assumes ownership of the test factory
3973 // Creates a new TestInfo object and registers it with Google Test;
3978 // test_case_name: name of the test case
3979 // name: name of the test
3980 // type_param: the name of the test's type parameter, or NULL if
3981 // this is not a typed or a type-parameterized test.
3982 // value_param: text representation of the test's value parameter,
3983 // or NULL if this is not a value-parameterized test.
3984 // code_location: code location where the test is defined
3985 // fixture_class_id: ID of the test fixture class
3986 // set_up_tc: pointer to the function that sets up the test case
3987 // tear_down_tc: pointer to the function that tears down the test case
3988 // factory: pointer to the factory that creates a test object.
4013 << "Attempted redefinition of test case " << test_case_name << ".\n"
4014 << "All tests in the same test case must use the same test fixture\n"
4015 << "class. However, in test case " << test_case_name << ", you tried\n"
4016 << "to define a test using a fixture class different from the one\n"
4020 << "test cases.";
4033 // A predicate that checks the test name of a TestInfo against a known
4049 // Returns true iff the test name of test_info matches name_.
4080 // Creates the test object, runs it, records its result, and then
4085 // Tells UnitTest where to store test result.
4091 // Notifies the unit test event listeners that a test is about to start.
4098 // Creates the test object.
4099 Test* const test = internal::HandleExceptionsInMethodIfSupported(
4101 "the test fixture's constructor");
4103 // Runs the test only if the test object was created and its
4105 if ((test != NULL) && !Test::HasFatalFailure()) {
4108 test->Run();
4111 // Deletes the test object.
4114 test, &Test::DeleteSelf_, "the test fixture's destructor");
4118 // Notifies the unit test event listener that a test has just finished.
4122 // test.
4128 // Gets the number of successful tests in this test case.
4133 // Gets the number of failed tests in this test case.
4143 // Gets the number of disabled tests in this test case.
4153 // Get the number of tests in this test case that should run.
4167 // name: name of the test case
4168 // a_type_param: the name of the test case's type parameter, or NULL if
4169 // this is not a typed or a type-parameterized test case.
4170 // set_up_tc: pointer to the function that sets up the test case
4171 // tear_down_tc: pointer to the function that tears down the test case
4173 Test::SetUpTestCaseFunc set_up_tc,
4174 Test::TearDownTestCaseFunc tear_down_tc)
4185 // Deletes every Test in the collection.
4189 // Returns the i-th test among all the tests. i can range from 0 to
4196 // Returns the i-th test among all the tests. i can range from 0 to
4203 // Adds a test to this test case. Will delete the test upon
4210 // Runs every test in this TestCase.
4238 // Clears the results of all tests in this test case.
4244 // Shuffles the tests in this test case.
4249 // Restores the test order to before the first shuffle.
4270 return FormatCountableNoun(test_count, "test", "tests");
4273 // Formats the count of test cases.
4275 return FormatCountableNoun(test_case_count, "test case", "test cases");
4281 // between the two when viewing the test result.
4317 // If the test program runs in Visual Studio or a debugger, the
4318 // following statements add the test part result message to the Output
4367 // Returns true iff Google Test should use colors in the output.
4456 // Text printed in Google Test's text output and --gunit_list_tests
4457 // output to label the type parameter and value parameter for a test.
4484 static void PrintTestName(const char * test_case, const char * test) {
4485 printf("%s.%s", test_case, test);
4525 "Note: This is test shard %d of %s.\n",
4546 printf("Global test environment set-up.\n");
4552 FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
4573 // If the test part succeeded, we don't need to do anything.
4605 FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
4616 printf("Global test environment tear-down\n");
4666 num_failures == 1 ? "TEST" : "TESTS");
4677 num_disabled == 1 ? "TEST" : "TESTS");
4679 // Ensure that Google Test output is printed before, e.g., heapchecker output.
4696 // in death test child processes.
4716 // in death test child processes.
4861 // Produces a string representing the test properties in a result as space
4883 // Called after the unit test ends.
4988 // This is how Google Test concepts map to the DTD:
4992 // <testcase name="test-name"> <-- corresponds to a TestInfo object
5191 // Produces a string representing the test properties in a result as space
5212 // arbitrarily long test failure message and stack trace.
5279 // trace stack maintained by Google Test.
5319 // don't want to fail the test because of this.
5445 // Gets the number of successful test cases.
5450 // Gets the number of failed test cases.
5455 // Gets the number of all test cases.
5460 // Gets the number of all test cases that contain at least one test
5495 // Gets the time of the test program start, in ms from the start of the
5506 // Returns true iff the unit test passed (i.e. all test cases passed).
5509 // Returns true iff the unit test failed (i.e. some test case failed
5513 // Gets the i-th test case among all the test cases. i can range from 0 to
5519 // Returns the TestResult containing information on test failures and
5520 // properties logged outside of individual test cases.
5525 // Gets the i-th test case among all the test cases. i can range from 0 to
5532 // inside Google Test.
5537 // Registers and returns a global test environment. When a test
5538 // program is run, all global test environments will be set-up in the
5540 // finished, all global test environments will be torn-down in the
5556 // Adds a TestPartResult to the current TestResult object. All Google Test
5594 // in the code (perhaps in order to use Google Test assertions
5623 // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
5641 // Google Test implements this protocol for catching that a test
5642 // program exits before returning control to Google Test:
5644 // 1. Upon start, Google Test creates a file whose absolute path
5647 // 2. When Google Test has finished its work, it deletes the file.
5649 // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before
5650 // running a Google-Test-based test program and check the existence
5651 // of the file at the end of the test execution to see if it has
5654 // If we are in the child process of a death test, don't
5659 // premature-exit file will be left undeleted, causing a test runner
5661 // test as having failed.
5671 // Either the user wants Google Test to catch exceptions thrown by the
5672 // tests or this is executing in the context of death test child
5683 // Death test children can be terminated with _abort(). On Windows,
5693 // executed. Google Test will notify the user of any unexpected
5712 "auxiliary test code (environments or event listeners)") ? 0 : 1;
5715 // Returns the working directory when the first TEST() or TEST_F() was
5721 // Returns the TestCase object for the test that's currently running,
5722 // or NULL if no test is running.
5729 // Returns the TestInfo object for the test that's currently running,
5730 // or NULL if no test is running.
5737 // Returns the random seed used at the start of the current test run.
5761 // Google Test trace stack.
5768 // Pops a trace from the per-thread Google Test trace stack.
5820 // context of a test, to current test case's ad_hoc_test_result when invoke
5842 // Disables event forwarding if the control is currently in a death test
5865 // Initializes event listeners for streaming test results in string form.
5913 // Configures listeners for streaming test results to the specified server.
5949 // test_case_name: name of the test case
5950 // type_param: the name of the test case's type parameter, or NULL if
5951 // this is not a typed or a type-parameterized test case.
5952 // set_up_tc: pointer to the function that sets up the test case
5953 // tear_down_tc: pointer to the function that tears down the test case
5956 Test::SetUpTestCaseFunc set_up_tc,
5957 Test::TearDownTestCaseFunc tear_down_tc) {
5970 // Is this a death test case?
5973 // Yes. Inserts the test case after the last death test case
5974 // defined so far. This only works when the test cases haven't
5975 // been shuffled. Otherwise we may end up running a death test
5976 // after a non-death test.
5996 // thrown during a test, the test is considered to be failed, but the
6007 "\nThis test program did NOT call ::testing::InitGoogleTest "
6012 // Do not run any test if the --help flag was specified.
6020 // Even if sharding is not on, test runners may want to use the
6021 // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
6026 // death test.
6041 // Compares the full test names with the filter to decide which
6057 // True iff at least one test has failed.
6066 // when we are inside the subprocess of a death test.
6071 // We want to preserve failures generated by ad-hoc test
6077 // Shuffles test cases and tests if requested.
6081 // such that a test event listener can see the actual test order
6086 // Tells the unit test event listeners that the tests are about to start.
6089 // Runs each test case if there is at least one test to run.
6098 if (!Test::HasFatalFailure()) {
6114 // Tells the unit test event listener that the tests have just finished.
6122 // Restores the original test order after the iteration. This
6151 "Could not write to the test shard status file \"%s\" "
6165 // disabled because it must only be applied to the original test
6226 // Given the total number of shards, the shard index, and the test id,
6227 // returns true iff the test should be run on this shard. The test id is
6228 // some arbitrary but unique non-negative integer assigned to each test
6234 // Compares the name of each test with the user-specified filter to
6235 // decide whether the test should be run, then records the result in
6261 // A test is disabled if test case name or test name matches
6382 // Returns the TestResult for the test that's currently running, or
6383 // the TestResult for the ad hoc test if no test is running.
6389 // Shuffles all test cases, and the tests within each test case,
6392 // Shuffles the death test cases.
6395 // Shuffles the non-death test cases.
6399 // Shuffles the tests inside each test case.
6405 // Restores the test cases and tests to their order before the first shuffle.
6408 // Unshuffles the tests in each test case.
6410 // Resets the index of each test case.
6551 // Determines whether a string has a prefix that Google Test uses for its
6553 // If Google Test detects that a command line flag has its prefix but is not
6555 // GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test
6576 // capturing to Google Test.
6615 "Test Selection:\n"
6618 " TEST(Foo, Bar) is \"Foo.Bar\".\n"
6627 "Test Execution:\n"
6633 " Random number seed to use for shuffling test orders (between 1 and\n"
6636 "Test Output:\n"
6640 " Don't print the elapsed time of each test.\n"
6647 " Stream test results to the given server.\n"
6653 " Set the default death test style.\n"
6660 " Do not report exceptions as test failures. Instead, allow them\n"
6727 // Parses the command line for Google Test flags, without initializing
6728 // other parts of Google Test. The type parameter CharType can be
6751 // Both help flag and unrecognized Google Test flags (excluding
6777 // Test with another testing framework.
6782 // Parses the command line for Google Test flags, without initializing
6783 // other parts of Google Test.
6813 // Initializes Google Test. This must be called before calling
6815 // flags that Google Test recognizes. Whenever a Google Test flag is
6818 // No value is returned. Instead, the Google Test flag variables are
6905 // Indicates that this translation unit is part of Google Test's
6917 // The default death test style.
6923 "Indicates how to run a death test in a forked child process: "
6924 "\"threadsafe\" (child process re-executes the test binary "
6925 "from the beginning, running only the specific death test) or "
6926 "\"fast\" (child process runs the death test immediately "
6945 "the single death test to run, and a file descriptor to "
6949 "death test. FOR INTERNAL USE ONLY.");
6957 // child process of a fast style death test.
6963 // executing in the context of the death test child process. Tools such as
7058 // Generates a textual failure message when a death test finds more than
7065 << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
7074 // Flag characters for reporting a death test that did not die.
7080 // An enumeration describing all of the possible ways that a death test can
7081 // conclude. DIED means that the process died while executing the test
7082 // code; LIVED means that process lived beyond the end of the test code;
7083 // RETURNED means that the test statement attempted to execute a return
7084 // statement, which is not allowed; THREW means that the test statement
7085 // returned control by throwing an exception. IN_PROGRESS means the test
7092 // exec-style death test child process, in which case the error
7098 // death test child process, which operates on a very small stack. Use
7153 // This is called from a death test parent process to read a failure
7154 // message from the death test child process and log it with the FATAL
7173 GTEST_LOG_(FATAL) << "Error while reading death test internal: "
7178 // Death test constructor. Increments the running death test count
7179 // for the current test.
7183 DeathTestAbort("Cannot run a death test outside of a TEST or "
7188 // Creates and returns a death test by dispatching to the current
7189 // death test factory.
7191 const char* file, int line, DeathTest** test) {
7193 statement, regex, file, line, test);
7238 // test child process via a pipe, interprets it to set the outcome_
7247 // The regular expression which test output must match. DeathTestImpl
7250 // True if the death test child process has been successfully spawned.
7254 // How the death test concluded.
7267 // test child process via a pipe, interprets it to set the outcome_
7275 // failure of the death test) or until the pipe is closed (signifying
7299 GTEST_LOG_(FATAL) << "Death test child process reported "
7304 GTEST_LOG_(FATAL) << "Read from death test child process failed: "
7311 // Signals that the death test code which should have exited, didn't.
7312 // Should be called only in a death test child process.
7316 // The parent process considers the death test to be a failure if
7335 // Returns an indented copy of stderr output for a death test.
7336 // This makes distinguishing death test output lines from regular log lines
7353 // Assesses the success or failure of a death test, using both private
7357 // outcome: An enumeration describing how the death test
7358 // concluded: DIED, LIVED, THREW, or RETURNED. The death test
7365 // the test's captured standard error output; the death test
7370 // this particular death test, which fails if it is false
7374 // reported. Also sets the last death test message string.
7384 buffer << "Death test: " << statement() << "\n";
7395 buffer << " Result: illegal return in test statement.\n"
7417 << "DeathTest::Passed somehow called before conclusion of test";
7427 // always threadsafe, and Google Test considers the
7448 // determines whether to fail the test.
7466 // The name of the file in which the death test is located.
7468 // The line number on which the death test is located.
7481 // Waits for the child in a death test to exit, returning its exit
7524 // The AssumeRole process for a Windows death test. It creates a child
7526 // death test. The child process is given the --gtest_filter and
7528 // current death test only.
7544 // a death test.
7632 // PID of child process during death test; 0 in the child process itself.
7641 // Waits for the child in a death test to exit, returning its exit
7656 // A concrete death test class that forks, then immediately runs the test
7665 // The AssumeRole process for a fork-and-run death test. It implements a
7683 // there are multiple threads running before the death test, and another
7698 // down in death test subprocesses.
7710 // A concrete death test class that forks and re-executes the main
7712 // only this specific death test to be run.
7730 // The name of the file in which the death test is located.
7732 // The line number on which the death test is located.
7770 // threadsafe-style death test process.
7778 // When Google Test is built as a framework on MacOS X, the environ variable
7791 // The main function for a threadsafe-style death test child process.
7798 // We need to execute the test program in the same environment where
7813 // invoke the test program via a valid path that contains at least
7848 // a thread-safe manner and instructs it to run the death test. The
7864 // We need to execute the test program in the same environment where
7948 // The AssumeRole process for a fork-and-exec death test. It re-executes the
7951 // death test to be re-run.
8002 // by the "test" argument to its address. If the test should be
8007 DeathTest** test) {
8017 "Death test count (" + StreamableToString(death_test_index)
8025 *test = NULL;
8034 *test = new WindowsDeathTest(statement, regex, file, line);
8040 *test = new ExecDeathTest(statement, regex, file, line);
8042 *test = new NoExecDeathTest(statement, regex);
8049 "Unknown death test style \"" + GTEST_FLAG(death_test_style)
8351 // Given directory = "dir", base_name = "test", number = 0,
8352 // extension = "xml", returns "dir/test.xml". If number is greater
8369 // Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".
8625 // Indicates that this translation unit is part of Google Test's
8843 // are the first to test it and need to perform the initialization.
9294 // characters to be indexable by size_t, in which case the test will
9506 // There's no guarantee that a test has write access to the current
9844 // Google Test - The Google C++ Testing Framework
9944 // Returns true if c is a printable ASCII character. We test the
10215 // The Google C++ Testing Framework (Google Test)
10218 // Indicates that this translation unit is part of Google Test's
10346 // Verifies that registered_tests match the test names in
10363 errors << "Test " << name << " is listed more than once.\n";
10380 errors << "No test named " << name
10381 << " can be found in this test case.\n";
10389 errors << "You forgot to list test " << it->first << ".\n";