TestComposite.h 923 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef CPPUNIT_TESTCOMPSITE_H // -*- C++ -*-
  2. #define CPPUNIT_TESTCOMPSITE_H
  3. #include <cppunit/Test.h>
  4. #include <string>
  5. CPPUNIT_NS_BEGIN
  6. /*! \brief A Composite of Tests.
  7. *
  8. * Base class for all test composites. Subclass this class if you need to implement
  9. * a custom TestSuite.
  10. *
  11. * \see Test, TestSuite.
  12. */
  13. class CPPUNIT_API TestComposite : public Test
  14. {
  15. public:
  16. TestComposite( const std::string &name = "" );
  17. ~TestComposite();
  18. void run( TestResult *result );
  19. int countTestCases() const;
  20. std::string getName() const;
  21. private:
  22. TestComposite( const TestComposite &other );
  23. TestComposite &operator =( const TestComposite &other );
  24. virtual void doStartSuite( TestResult *controller );
  25. virtual void doRunChildTests( TestResult *controller );
  26. virtual void doEndSuite( TestResult *controller );
  27. private:
  28. const std::string m_name;
  29. };
  30. CPPUNIT_NS_END
  31. #endif // CPPUNIT_TESTCOMPSITE_H