This class allows the test authors to group related ITest subclasses together within a single test. The tests in the collection are run sequentially to determine the success or failure of the entire group. The resulting test passes if all of its subtests pass, and fails otherwise. The subtests are always executed in a fixed order (the order in which subtests were added). The subtests can be run in random order if you call the "randomlyReorder" method after adding subtests. ITestCollection does not halt on subtest failure. It runs all the subtests by default. To change this default behavior, the "setHaltOnFail(true)" method in your setupSubtests.
Clients should derive a subclass and override setupSubtests method. In setupSubtests, clients should call "adoptTest" for each subtest.
Constructors & DestructorClass constructors and destructors.
![]() |
public:
virtual ~ITestCollection()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
ITestCollection()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
public:
ITestCollection(const ITestCollection&)
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
ITestCollection& operator =(const ITestCollection&)
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Collection Test SetupClass members used to set up the collection of tests.
![]() |
public:
virtual void adoptTest(ITest* subTest)
The caller must not delete the subTest after calling adopt. ITestCollection takes ownership of the subTest and will manage storage.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual void propagateInputs(ITest& subtest)
Derived classes can override this method to alter this behavior. For example, subclasses may wish to parse or process the inputs before passing them to subtests, or generate inputs for the subtests.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual void setupSubtests()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Input and OutputClass members used to display information to the user.
![]() |
protected:
virtual void print(ITieredTextBuffer&)
First calls ITest::print(out), and the prints the number of subtests and the current setting of haltOnFail.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Meta InformationClass member functions used to provide information about the tests.
![]() |
public:
virtual void copyInfo()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Test ControlClass member functions used to control how to run the collection of tests.
![]() |
public:
bool haltOnFail() const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
virtual void randomlyReorder(long initialSeed = 0)
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
void setHaltOnFail(bool)
If client calls this function with true, ITestCollection will halt when any of its subtests fails. If the client calls this function with false, ITestCollection will continue running all tests, even if one or more of the subtests fail. The default behavior is running all tests.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Test MethodsITest overridden member function used when setting up and running the collection of tests.
![]() |
protected:
virtual void reset()
Subclasses should not need to override reset.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual void setup()
ITestCollection calls setupSubtests to create all the subtests. setupSubtests is called only once when setup is called for the first time. Next, it calls propagateInputs for all subtests. It then calls ITest::setup.
Subclasses should not need to override setup.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual void test()
Subclasses should not override test.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
virtual ~ITest()
void copyInputs(int& argc, char * *& argv) const
virtual EStage exceptionStage() const
virtual bool lookupInfo(const IString& key, IString& info)
ITest& operator =(const ITest& test)
ITieredTextBuffer& outputTextStream()
virtual void run()
virtual unsigned long runCount() const
void setInputs(const int argc, const char * const* argv)
bool success() const
static const IString & _Import kComponentKey
static const IString& kComponentKey
static const IString & _Import kDescriptionKey
static const IString& kDescriptionKey
static const IString & _Import kInputSyntaxKey
static const IString& kInputSyntaxKey
static const IString& kTargetClassKey
static const IString & _Import kTargetClassKey
static const IString& kTestNameKey
static const IString & _Import kTestNameKey
static const IString& kTestTypeKey
static const IString & _Import kTestTypeKey
static const IString& kTestVersionKey
static const IString & _Import kTestVersionKey