diff options
Diffstat (limited to 'include/cppunit')
| -rw-r--r-- | include/cppunit/extensions/AutoRegisterSuite.h | 2 | ||||
| -rw-r--r-- | include/cppunit/extensions/HelperMacros.h | 27 | ||||
| -rw-r--r-- | include/cppunit/extensions/TestFactoryRegistry.h | 2 |
3 files changed, 25 insertions, 6 deletions
diff --git a/include/cppunit/extensions/AutoRegisterSuite.h b/include/cppunit/extensions/AutoRegisterSuite.h index 7033412..28a3e7c 100644 --- a/include/cppunit/extensions/AutoRegisterSuite.h +++ b/include/cppunit/extensions/AutoRegisterSuite.h @@ -15,7 +15,7 @@ namespace CppUnit { * This object is intented to be used as a static variable. * * \param TestCaseType Type of the test case which suite is registered. - * \see CPPUNIT_TEST_SUITE_REGISTRATION. + * \see CPPUNIT_TEST_SUITE_REGISTRATION, CppUnit::TestFactoryRegistry. */ template<typename TestCaseType> class AutoRegisterSuite diff --git a/include/cppunit/extensions/HelperMacros.h b/include/cppunit/extensions/HelperMacros.h index 9291fc7..08307eb 100644 --- a/include/cppunit/extensions/HelperMacros.h +++ b/include/cppunit/extensions/HelperMacros.h @@ -241,13 +241,34 @@ * \param ATestCaseType Type of the test case class. * \warning This macro should be used only once per line of code (the line * number is used to name a hidden static variable). - * \see CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite. + * \see CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite, + * CppUnit::TestFactoryRegistry. */ -#define CPPUNIT_TEST_SUITE_REGISTRATION( ATestCaseType ) \ - static CppUnit::AutoRegisterSuite< ATestCaseType > \ +#define CPPUNIT_TEST_SUITE_REGISTRATION( ATestCaseType ) \ + static CppUnit::AutoRegisterSuite< ATestCaseType > \ __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite ) +/** Register test suite into the specified global registry suite. + * + * This macro declares a static variable whose construction + * causes a test suite factory to be inserted in the global registry + * suite of the specified name. The registry is available by calling + * the static function CppUnit::TestFactoryRegistry::getRegistry(). + * + * \param ATestCaseType Type of the test case class. + * \param suiteName Name of the global registry suite the test suite is + * registered into. + * \warning This macro should be used only once per line of code (the line + * number is used to name a hidden static variable). + * \see CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite, + * CppUnit::TestFactoryRegistry.. + */ +#define CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ATestCaseType, suiteName ) \ + static CppUnit::AutoRegisterSuite< ATestCaseType > \ + __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite )(suiteName) + + // Backwards compatibility // (Not tested!) diff --git a/include/cppunit/extensions/TestFactoryRegistry.h b/include/cppunit/extensions/TestFactoryRegistry.h index e835321..a9edea2 100644 --- a/include/cppunit/extensions/TestFactoryRegistry.h +++ b/include/cppunit/extensions/TestFactoryRegistry.h @@ -66,8 +66,6 @@ namespace CppUnit { typedef std::map<std::string, TestFactory *> Factories; Factories m_factories; - typedef std::map<std::string, TestFactoryRegistry *> NamedRegistries; - std::string m_name; }; |
