The class TestSuite (see Figure C-31) implements the interface Test . It is a composite of Test objects. Since the contained Test objects may be instances of TestCase , TestSuite , or any other subclass of Test , this allows hierarchies of Test classes to be assembled and run as a unit. A TestSuite is run just like a TestCase : by calling its run( ) method and passing in a TestResult to receive the results. The TestSuite then sequentially runs the Test objects it contains.
A TestSuite takes ownership of all Test objects added to it and deletes them in its destructor.
TestSuite belongs to the namespace CppUnit . It is declared in the file TestSuite.h and implemented in the file TestSuite.cpp .
class TestSuite : public Test
Constructs a TestSuite , optionally giving it a name.
A destructor. Deletes all the contained Test objects.
Adds a Test to this TestSuite .
Returns the total number of TestCase objects to be run by this TestSuite , by recursively calling countTestCases( ) on all the contained Test objects.
Deletes all the contained Test objects.
Returns the name of this TestSuite .
Returns the collection of contained Test objects.
Runs the Test objects and receives the results in result .
Returns a string representation of this TestSuite .
A copy constructor declared private to prevent its use.
A copy operator declared private to prevent its use.
The name of this TestSuite . May be empty ( private ).
The collection of Test objects belonging to this TestSuite ( private ).