| CppUnit project page | FAQ | CppUnit home page |
Classes | |
| class | TestFactoryRegistry |
| Registry for TestFactory.Notes that the registry DON'T assumes lifetime control for any registered tests anymore. More... | |
| class | TestSuite |
| A Composite of Tests.It runs a collection of test cases. Here is an example. More... | |
Macros | |
| #define | CPPUNIT_TEST_SUITE_REGISTRATION(ATestFixtureType) |
| #define | CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(ATestFixtureType, suiteName) |
| Adds the specified fixture suite to the specified registry suite. More... | |
| #define | CPPUNIT_REGISTRY_ADD(which, to) |
| #define | CPPUNIT_REGISTRY_ADD_TO_DEFAULT(which) |
| #define CPPUNIT_REGISTRY_ADD | ( | which, | |
| to | |||
| ) |
Adds that the specified registry suite to another registry suite.
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:
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.
| which | Name of the registry suite to add to the registry suite named to. |
| to | Name of the registry suite which is added to. |
| #define CPPUNIT_REGISTRY_ADD_TO_DEFAULT | ( | which) |
Adds that the specified registry suite to the default registry suite.
This macro is just like CPPUNIT_REGISTRY_ADD except the specified registry suite is added to the default suite (root suite).
| which | Name of the registry suite to add to the default registry suite. |
| #define CPPUNIT_TEST_SUITE_NAMED_REGISTRATION | ( | ATestFixtureType, | |
| suiteName | |||
| ) |
Adds the specified fixture suite to the specified 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().
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.
| ATestFixtureType | Type of the test case class. |
| suiteName | Name of the global registry suite the test suite is registered into. |
| #define CPPUNIT_TEST_SUITE_REGISTRATION | ( | ATestFixtureType) |
Adds the specified fixture suite to the unnamed registry.
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().
| ATestFixtureType | Type of the test case class. |
|
|
hosts this site. |
Send comments to: CppUnit Developers |