1#ifndef CPPUNIT_EXTENSIONS_REPEATEDTEST_H 2#define CPPUNIT_EXTENSIONS_REPEATEDTEST_H 3 4#include <cppunit/Portability.h> 5#include <cppunit/extensions/TestDecorator.h> 6 7namespace CppUnit { 8 9class Test; 10class TestResult; 11 12 13/*! \brief Decorator that runs a test repeatedly. 14 * 15 * Does not assume ownership of the test it decorates 16 */ 17class CPPUNIT_API RepeatedTest : public TestDecorator 18{ 19public: 20 RepeatedTest( Test *test, 21 int timesRepeat ) : 22 TestDecorator( test ), 23 m_timesRepeat(timesRepeat) {} 24 25 void run( TestResult *result ); 26 int countTestCases() const; 27 std::string toString() const; 28 29private: 30 RepeatedTest( const RepeatedTest & ); 31 void operator=( const RepeatedTest & ); 32 33 const int m_timesRepeat; 34}; 35 36 37 38} // namespace CppUnit 39 40#endif // CPPUNIT_EXTENSIONS_REPEATEDTEST_H 41