CppUnit project page FAQ CppUnit home page

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

CppUnit::TextTestRunner Class Reference

A text mode test runner. More...

#include <TextTestRunner.h>

Collaboration diagram for CppUnit::TextTestRunner:

Collaboration graph
[legend]
List of all members.

Public Methods

 TextTestRunner ()
virtual ~TextTestRunner ()
void run (std::string testName="", bool wait=false)
 Runs the named test case. More...

void addTest (Test *test)
 Adds the specified test. More...


Protected Methods

void runTest (Test *test)
void runTestByName (std::string testName)
void wait (bool doWait)
TestfindTestByName (std::string name) const

Protected Attributes

TestSuitem_suite

Detailed Description

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:

 TextTestRunner runner;
 runner.addTest( ExampleTestCase::suite() );
 runner.run( "", true );    // Run all tests and wait


Constructor & Destructor Documentation

CppUnit::TextTestRunner::TextTestRunner  
 

CppUnit::TextTestRunner::~TextTestRunner   [virtual]
 


Member Function Documentation

void CppUnit::TextTestRunner::addTest Test *   test
 

Adds the specified test.

Parameters:
test   Test to add.

Test * CppUnit::TextTestRunner::findTestByName std::string   name const [protected]
 

void CppUnit::TextTestRunner::run std::string   testName = "",
bool   doWait = false
 

Runs the named test case.

Parameters:
testName   Name of the test case to run. If an empty is given, then all added test are run. The name must be the name of of an added test.
doWait   if true then the user must press the RETURN key before the run() method exit.

void CppUnit::TextTestRunner::runTest Test *   test [protected]
 

void CppUnit::TextTestRunner::runTestByName std::string   testName [protected]
 

void CppUnit::TextTestRunner::wait bool   doWait [protected]
 


Member Data Documentation

TestSuite* CppUnit::TextTestRunner::m_suite [protected]
 


The documentation for this class was generated from the following files:
SourceForge Logo hosts this site. Send comments to:
CppUnit Developers