RepeatedTest.h 782 B

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