Menu

[r197]: / trunk / cppunit / include / cppunit / TextTestRunner.h  Maximize  Restore  History

Download this file

53 lines (42 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef CPPUNIT_TEXTTESTRUNNER_H
#define CPPUNIT_TEXTTESTRUNNER_H
#include <string>
#include <vector>
namespace CppUnit {
class Test;
class TestSuite;
/**
* A text mode test runner.
*
* The test runner manage the life cycle of the added tests.
*
* The test runner can run only one of the added tests or all the tests.
*
* TestRunner prints out a trace as the tests are executed followed by a
* summary at the end.
*
* Here is an example of use:
*
* \code
* TextTestRunner runner;
* runner.addTest( ExampleTestCase::suite() );
* runner.run( "", true ); // Run all tests and wait
* \endcode
*/
class TextTestRunner
{
public:
TextTestRunner();
virtual ~TextTestRunner();
bool run( std::string testName ="",
bool wait = false );
void addTest( Test *test );
protected:
bool runTest( Test *test );
bool runTestByName( std::string testName );
void wait( bool doWait );
Test *findTestByName( std::string name ) const;
TestSuite *m_suite;
};
} // namespace CppUnit
#endif // CPPUNIT_TEXTTESTRUNNER_H
MongoDB Logo MongoDB