1
#ifndef CPPUNIT_TESTSUITE_H // -*- C++ -*-
2
#define CPPUNIT_TESTSUITE_H
4
#include <cppunit/Portability.h>
6
#if CPPUNIT_NEED_DLL_DECL
7
#pragma warning( push )
8
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
11
#include <cppunit/TestComposite.h>
12
#include <cppunit/portability/CppUnitVector.h>
17
#if CPPUNIT_NEED_DLL_DECL
18
// template class CPPUNIT_API std::vector<Test *>;
22
/*! \brief A Composite of Tests.
23
* \ingroup CreatingTestSuite
25
* It runs a collection of test cases. Here is an example.
27
* CppUnit::TestSuite *suite= new CppUnit::TestSuite();
28
* suite->addTest(new CppUnit::TestCaller<MathTest> (
29
* "testAdd", testAdd));
30
* suite->addTest(new CppUnit::TestCaller<MathTest> (
31
* "testDivideByZero", testDivideByZero));
33
* Note that \link TestSuite TestSuites \endlink assume lifetime
34
* control for any tests added to them.
36
* TestSuites do not register themselves in the TestRegistry.
40
class CPPUNIT_API TestSuite : public TestComposite
43
/*! Constructs a test suite with the specified name.
45
TestSuite( std::string name = "" );
49
/*! Adds the specified test to the suite.
50
* \param test Test to add. Must not be \c NULL.
52
void addTest( Test *test );
54
/*! Returns the list of the tests (DEPRECATED).
55
* \deprecated Use getChildTestCount() & getChildTestAt() of the
56
* TestComposite interface instead.
57
* \return Reference on a vector that contains the tests of the suite.
59
const CppUnitVector<Test *> &getTests() const;
61
/*! Destroys all the tests of the suite.
63
virtual void deleteContents();
65
int getChildTestCount() const;
67
Test *doGetChildTestAt( int index ) const;
70
CppUnitVector<Test *> m_tests;
76
#if CPPUNIT_NEED_DLL_DECL
77
#pragma warning( pop )
80
#endif // CPPUNIT_TESTSUITE_H