diff options
author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-11-20 01:40:35 +0000 |
---|---|---|
committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-11-20 01:40:35 +0000 |
commit | 3d7042176307f0d7700a3640f3b3bcc8790b8fcd (patch) | |
tree | ec4a9020570acc6d09366e5b305b9d162c1a6026 /src/gtest-internal-inl.h | |
parent | b6a296d0f7caff7140f422e49f5398c9ef17504d (diff) | |
download | googletest-3d7042176307f0d7700a3640f3b3bcc8790b8fcd.tar.gz googletest-3d7042176307f0d7700a3640f3b3bcc8790b8fcd.tar.bz2 googletest-3d7042176307f0d7700a3640f3b3bcc8790b8fcd.zip |
Value-parameterized tests and many bugfixes
Diffstat (limited to 'src/gtest-internal-inl.h')
-rw-r--r-- | src/gtest-internal-inl.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h index ce1d0f4f..0f2bcfba 100644 --- a/src/gtest-internal-inl.h +++ b/src/gtest-internal-inl.h @@ -53,7 +53,6 @@ #include <windows.h> // NOLINT #endif // GTEST_OS_WINDOWS -#include <ostream> // NOLINT #include <gtest/gtest.h> #include <gtest/gtest-spi.h> @@ -846,7 +845,7 @@ class OsStackTraceGetterInterface { GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface); }; -// A working implemenation of the OsStackTraceGetterInterface interface. +// A working implementation of the OsStackTraceGetterInterface interface. class OsStackTraceGetter : public OsStackTraceGetterInterface { public: OsStackTraceGetter() {} @@ -1063,6 +1062,14 @@ class UnitTestImpl { tear_down_tc)->AddTestInfo(test_info); } +#ifdef GTEST_HAS_PARAM_TEST + // Returns ParameterizedTestCaseRegistry object used to keep track of + // value-parameterized tests and instantiate and register them. + internal::ParameterizedTestCaseRegistry& parameterized_test_registry() { + return parameterized_test_registry_; + } +#endif // GTEST_HAS_PARAM_TEST + // Sets the TestCase object for the test that's currently running. void set_current_test_case(TestCase* current_test_case) { current_test_case_ = current_test_case; @@ -1075,6 +1082,14 @@ class UnitTestImpl { current_test_info_ = current_test_info; } + // Registers all parameterized tests defined using TEST_P and + // INSTANTIATE_TEST_P, creating regular tests for each test/parameter + // combination. This method can be called more then once; it has + // guards protecting from registering the tests more then once. + // If value-parameterized tests are disabled, RegisterParameterizedTests + // is present but does nothing. + void RegisterParameterizedTests(); + // Runs all tests in this UnitTest object, prints the result, and // returns 0 if all tests are successful, or 1 otherwise. If any // exception is thrown during a test on Windows, this test is @@ -1169,6 +1184,15 @@ class UnitTestImpl { internal::List<TestCase*> test_cases_; // The list of TestCases. +#ifdef GTEST_HAS_PARAM_TEST + // ParameterizedTestRegistry object used to register value-parameterized + // tests. + internal::ParameterizedTestCaseRegistry parameterized_test_registry_; + + // Indicates whether RegisterParameterizedTests() has been called already. + bool parameterized_tests_registered_; +#endif // GTEST_HAS_PARAM_TEST + // Points to the last death test case registered. Initially NULL. internal::ListNode<TestCase*>* last_death_test_case_; |