CppUnit - The Unit Testing Library

CppUnit project page | FAQ

TestRunner.h
Go to the documentation of this file.
1#ifndef CPPUNIT_TESTRUNNER_H
2#define CPPUNIT_TESTRUNNER_H
3
4#include <cppunit/TestSuite.h>
5#include <string>
6
7 CPPUNIT_NS_BEGIN
8
9
10class Test;
11class TestResult;
12
13
72 class CPPUNIT_API TestRunner
73{
74public:
77 TestRunner( );
78
80 virtual ~TestRunner();
81
85 virtual void addTest( Test *test );
86
94 virtual void run( TestResult &controller,
95 const std::string &testPath = "" );
96
97protected:
100 class CPPUNIT_API WrappingSuite : public TestSuite
101 {
102 public:
103 WrappingSuite( const std::string &name = "All Tests" );
104
105 int getChildTestCount() const;
106
107 std::string getName() const;
108
109 void run( TestResult *result );
110
111 protected:
112 Test *doGetChildTestAt( int index ) const;
113
114 bool hasOnlyOneTest() const;
115
116 Test *getUniqueChildTest() const;
117 };
118
119protected:
120 WrappingSuite *m_suite;
121
122private:
124 TestRunner( const TestRunner &copy );
125
127 void operator =( const TestRunner &copy );
128
129private:
130};
131
132
133 CPPUNIT_NS_END
134
135#endif // CPPUNIT_TESTRUNNER_H
CPPUNIT_API
#define CPPUNIT_API
Definition CppUnitApi.h:27
CPPUNIT_NS_END
#define CPPUNIT_NS_END
Definition Portability.h:106
CPPUNIT_NS_BEGIN
#define CPPUNIT_NS_BEGIN
Definition Portability.h:105
TestSuite.h
Test
Base class for all test objects.
Definition Test.h:26
TestResult
Manages TestListener.
Definition TestResult.h:48
TestRunner::WrappingSuite
(INTERNAL) Mutating test suite.
Definition TestRunner.h:101
TestRunner::WrappingSuite::getName
std::string getName() const
Returns the test name.
Definition TestRunner.cpp:26
TestRunner::WrappingSuite::doGetChildTestAt
Test * doGetChildTestAt(int index) const
Returns the child test of the specified valid index.
Definition TestRunner.cpp:35
TestRunner::WrappingSuite::getChildTestCount
int getChildTestCount() const
Returns the number of direct child of the test.
Definition TestRunner.cpp:17
TestRunner::WrappingSuite::getUniqueChildTest
Test * getUniqueChildTest() const
Definition TestRunner.cpp:61
TestRunner::WrappingSuite::run
void run(TestResult *result)
Run the test, collecting results.
Definition TestRunner.cpp:44
TestRunner::WrappingSuite::WrappingSuite
WrappingSuite(const std::string &name="All Tests")
Definition TestRunner.cpp:10
TestRunner::WrappingSuite::hasOnlyOneTest
bool hasOnlyOneTest() const
Definition TestRunner.cpp:54
TestRunner::run
virtual void run(TestResult &controller, const std::string &testPath="")
Runs a test using the specified controller.
Definition TestRunner.cpp:90
TestRunner::addTest
virtual void addTest(Test *test)
Adds the specified test.
Definition TestRunner.cpp:83
TestRunner::TestRunner
TestRunner(const TestRunner &copy)
Prevents the use of the copy constructor.
TestRunner::TestRunner
TestRunner()
Constructs a TestRunner object.
Definition TestRunner.cpp:70
TestRunner::m_suite
WrappingSuite * m_suite
Definition TestRunner.h:120
TestSuite::TestSuite
TestSuite(std::string name="")
Default constructor.
Definition TestSuite.cpp:9

| Send comments to: CppUnit Developers