Value:
static CPPUNIT_NS::AutoRegisterRegistry \ CPPUNIT_MAKE_UNIQUE_NAME( autoRegisterRegistry__ )( which, to )
Use this macros to automatically create test registry suite hierarchy. For example, if you want to create the following hierarchy:
You can do this automatically with:
CPPUNIT_REGISTRY_ADD( "FastFloat", "FloatMath" ); CPPUNIT_REGISTRY_ADD( "IntegerMath", "Math" ); CPPUNIT_REGISTRY_ADD( "FloatMath", "Math" ); CPPUNIT_REGISTRY_ADD( "StandardFloat", "FloatMath" );
There is no specific order of declaration. Think of it as declaring links.
You register the test in each suite using CPPUNIT_TEST_SUITE_NAMED_REGISTRATION.
Value:
static CPPUNIT_NS::AutoRegisterRegistry \ CPPUNIT_MAKE_UNIQUE_NAME( autoRegisterRegistry__ )( which )
This macro is just like CPPUNIT_REGISTRY_ADD except the specified registry suite is added to the default suite (root suite).
Value:
static CPPUNIT_NS::AutoRegisterSuite< ATestFixtureType > \ CPPUNIT_MAKE_UNIQUE_NAME(autoRegisterRegistry__ )(suiteName)
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().
For the suite name, use a string returned by a static function rather than a hardcoded string. That way, you can know what are the name of named registry and you don't risk mistyping the registry name.
// MySuites.h namespace MySuites { std::string math() { return "Math"; } } // ComplexNumberTest.cpp #include "MySuites.h" CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ComplexNumberTest, MySuites::math() );
CPPUNIT_REGISTRY_ADD_TO_DEFAULT
CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite, CppUnit::TestFactoryRegistry..
Value:
static CPPUNIT_NS::AutoRegisterSuite< ATestFixtureType > \ CPPUNIT_MAKE_UNIQUE_NAME(autoRegisterRegistry__ )
This macro declares a static variable whose construction causes a test suite factory to be inserted in a global registry of such factories. The registry is available by calling the static function CppUnit::TestFactoryRegistry::getRegistry().
CPPUNIT_REGISTRY_ADD_TO_DEFAULT
CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite, CppUnit::TestFactoryRegistry.