CppUnit - The Unit Testing Library

CppUnit project page | FAQ

TestSuite.h
Go to the documentation of this file.
1#ifndef CPPUNIT_TESTSUITE_H // -*- C++ -*-
2#define CPPUNIT_TESTSUITE_H
3
4#include <cppunit/Portability.h>
5
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
9#endif
10
11#include <cppunit/TestComposite.h>
12#include <vector>
13
14 CPPUNIT_NS_BEGIN
15
16
17#if CPPUNIT_NEED_DLL_DECL
18// template class CPPUNIT_API std::vector<Test *>;
19#endif
20
21
40 class CPPUNIT_API TestSuite : public TestComposite
41{
42public:
45 TestSuite( std::string name = "" );
46
47 ~TestSuite();
48
52 void addTest( Test *test );
53
59 const std::vector<Test *> &getTests() const;
60
63 virtual void deleteContents();
64
65 int getChildTestCount() const;
66
67 Test *doGetChildTestAt( int index ) const;
68
69private:
70 std::vector<Test *> m_tests;
71};
72
73
74 CPPUNIT_NS_END
75
76#if CPPUNIT_NEED_DLL_DECL
77#pragma warning( pop )
78#endif
79
80#endif // CPPUNIT_TESTSUITE_H
CPPUNIT_API
#define CPPUNIT_API
Definition CppUnitApi.h:27
Portability.h
CPPUNIT_NS_END
#define CPPUNIT_NS_END
Definition Portability.h:106
CPPUNIT_NS_BEGIN
#define CPPUNIT_NS_BEGIN
Definition Portability.h:105
TestComposite.h
TestComposite::TestComposite
TestComposite(const std::string &name="")
Definition TestComposite.cpp:8
Test
Base class for all test objects.
Definition Test.h:26
Test::getChildTestCount
virtual int getChildTestCount() const =0
Returns the number of direct child of the test.
Test::doGetChildTestAt
virtual Test * doGetChildTestAt(int index) const =0
Returns the child test of the specified valid index.
TestSuite::deleteContents
virtual void deleteContents()
Deletes all tests in the suite.
Definition TestSuite.cpp:25
TestSuite::TestSuite
TestSuite(std::string name="")
Default constructor.
Definition TestSuite.cpp:9
TestSuite::addTest
void addTest(Test *test)
Adds a test to the suite.
Definition TestSuite.cpp:37
TestSuite::getTests
const std::vector< Test * > & getTests() const
Definition TestSuite.cpp:44
TestSuite::m_tests
std::vector< Test * > m_tests
Definition TestSuite.h:70

| Send comments to: CppUnit Developers