class TestRepeater : Test

Repeats tests multiple times

This class could be used to repeat unit test or even whole test suites a given number of times. This also includes the repeated execution of the set-up and tear-down methods.



Public Members:
    TestRepeater (const string& name, int repetitions, Test* test, bool breakOnFailure = false) ;
    Create a test repeater with the given name and test to repeat.
    The given test is executed the specified number of repetitions. If breakOnFailure is true, repeating the test is stopped immediately when the test fails. Otherwise, all repetitions are executed regardless if executing the test is successful or not.

    virtual ~TestRepeater () ;
    Destructor for the test repetition
    The given base test is also deleted.

    virtual bool run (TestConductor& conductor) ;
    Run the base test n-times under control of then given test conductor.
    The base test specified in the constructor is executed multiple times under control of the conductor.

    virtual void setUp () ;
    Set up the test environment.
    Does nothing.

    virtual void test (TestConductor& conductor) ;
    Run the base test multiple times.
    How often the test is actually executed the full number of repetitions depends on breakOnFailure and the test outcomes (see constructor).

    virtual void tearDown () ;
    Tear down the test environment.
    Does nothing.

    virtual bool isTestCase () const ;
    Test if this is a test case.
    Returns always false, because the repeater itself does not check functionality in the application domain. So it is more similar to a test suite.

    virtual int noTestCases () const ;
    Count the number of test cases.
    Returns the number of test cases in the base test, multiplied with the number of repetitions.

    virtual int noTestSuites () const ;
    Count the number of test suites.
    Returns the number of test suites in the base test, multiplied with the number of repetitions plus one.

    virtual void put (ostream& stream) const ;
    Output the test repeater to the stream.
    The name and the number of repetitions are printed.




The Scrunitizer C++ Unit Test Framework
by Bernd Linowski

[Scrunitizer]  [Overview]  [Cookbook]  [Download]  [Index]  [Linosphere]

Page generated: 1 Nov 2000
(C) by Bernd Linowski
scrunitizer@linosphere.de