CppUnit - The Unit Testing Library

CppUnit project page | FAQ

ui/text/TextTestRunner.h
Go to the documentation of this file.
1#ifndef CPPUNIT_UI_TEXT_TEXTTESTRUNNER_H
2#define CPPUNIT_UI_TEXT_TEXTTESTRUNNER_H
3
4
5#include <cppunit/Portability.h>
6#include <string>
7#include <cppunit/TestRunner.h>
8
9 CPPUNIT_NS_BEGIN
10
11
12class Outputter;
13class Test;
14class TestSuite;
15class TextOutputter;
16class TestResult;
17class TestResultCollector;
18
19
20
63 class CPPUNIT_API TextTestRunner : public CPPUNIT_NS::TestRunner
64{
65public:
66 TextTestRunner( Outputter *outputter =NULL );
67
68 virtual ~TextTestRunner();
69
70 bool run( std::string testPath ="",
71 bool doWait = false,
72 bool doPrintResult = true,
73 bool doPrintProgress = true );
74
75 void setOutputter( Outputter *outputter );
76
77 TestResultCollector &result() const;
78
79 TestResult &eventManager() const;
80
81public: // overridden from TestRunner (to avoid hidden virtual function warning)
82 virtual void run( TestResult &controller,
83 const std::string &testPath = "" );
84
85protected:
86 virtual void wait( bool doWait );
87 virtual void printResult( bool doPrintResult );
88
89private:
90 // prohibit copying
91 TextTestRunner( const TextTestRunner& );
92 // prohibit copying
93 TextTestRunner& operator=( const TextTestRunner& );
94
95 TestResultCollector *m_result;
96 TestResult *m_eventManager;
97 Outputter *m_outputter;
98};
99
100
101 CPPUNIT_NS_END
102
103#endif // CPPUNIT_UI_TEXT_TEXTTESTRUNNER_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
TestRunner.h
Outputter
Abstract outputter to print test result summary.
Definition Outputter.h:14
Test
Base class for all test objects.
Definition Test.h:26
TestResultCollector
Collects test result.
Definition TestResultCollector.h:32
TestResult
Manages TestListener.
Definition TestResult.h:48
TestSuite
A Composite of Tests.
Definition TestSuite.h:41
TextOutputter
Prints a TestResultCollector to a text stream.
Definition TextOutputter.h:21
TextTestRunner::m_outputter
Outputter * m_outputter
Definition ui/text/TextTestRunner.h:97
TextTestRunner::eventManager
TestResult & eventManager() const
Definition TextTestRunner.cpp:114
TextTestRunner::TextTestRunner
TextTestRunner(const TextTestRunner &)
TextTestRunner::printResult
virtual void printResult(bool doPrintResult)
Definition TextTestRunner.cpp:91
TextTestRunner::operator=
TextTestRunner & operator=(const TextTestRunner &)
TextTestRunner::result
TestResultCollector & result() const
Definition TextTestRunner.cpp:103
TextTestRunner::m_result
TestResultCollector * m_result
Definition ui/text/TextTestRunner.h:95
TextTestRunner::setOutputter
void setOutputter(Outputter *outputter)
Definition TextTestRunner.cpp:129
TextTestRunner::TextTestRunner
TextTestRunner(Outputter *outputter=NULL)
Definition TextTestRunner.cpp:20
TextTestRunner::wait
virtual void wait(bool doWait)
Definition TextTestRunner.cpp:77
TextTestRunner::m_eventManager
TestResult * m_eventManager
Definition ui/text/TextTestRunner.h:96
TextTestRunner::run
bool run(std::string testPath="", bool doWait=false, bool doPrintResult=true, bool doPrintProgress=true)
Definition TextTestRunner.cpp:54

| Send comments to: CppUnit Developers