CppUnit project page FAQ CppUnit home page

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CppUnit::TestListener Class Reference
[Tracking test execution]

Listener for test progress and result. More...

#include <TestListener.h>

Inheritance diagram for CppUnit::TestListener:

CppUnit::TestSucessListener CppUnit::TextTestProgressListener CppUnit::TestResultCollector CppUnit::TextTestResult List of all members.

Public Methods

virtual ~TestListener ()
virtual void startTest (Test *test)
 Called when just before a TestCase is run. More...

virtual void addFailure (const TestFailure &failure)
virtual void endTest (Test *test)
 Called just after a TestCase was run (even if a failure occured). More...


Detailed Description

Listener for test progress and result.

Implementing the Observer pattern a TestListener may be registered to a TestResult to obtain information on the testing progress. Use specialized sub classes of TestListener for text output (TextTestProgressListener). Do not use the Listener for the test result output, use a subclass of Outputter instead.

The test framework distinguishes between failures and errors. A failure is anticipated and checked for with assertions. Errors are unanticipated problems signified by exceptions that are not generated by the framework.

See also:
TestResult


Constructor & Destructor Documentation

virtual CppUnit::TestListener::~TestListener   [inline, virtual]
 


Member Function Documentation

virtual void CppUnit::TestListener::addFailure const TestFailure   failure [inline, virtual]
 

Called when a failure occurs while running a test.

See also:
TestFailure.
Warning:
failure is a temporary object that is destroyed after the method call. Use TestFailure::clone() to create a duplicate.

Reimplemented in CppUnit::TestResultCollector.

virtual void CppUnit::TestListener::endTest Test   test [inline, virtual]
 

Called just after a TestCase was run (even if a failure occured).

virtual void CppUnit::TestListener::startTest Test   test [inline, virtual]
 

Called when just before a TestCase is run.

Reimplemented in CppUnit::TestResultCollector.


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