CppUnit project page | FAQ | CppUnit home page |
#include <TestResult.h>
Inheritance diagram for CppUnit::TestResult:
Public Methods | |
TestResult (SynchronizationObject *syncObject=0) | |
Construct a TestResult. More... | |
virtual | ~TestResult () |
Destroys a test result. More... | |
virtual void | addListener (TestListener *listener) |
virtual void | removeListener (TestListener *listener) |
virtual void | reset () |
Resets the result for a new run. More... | |
virtual void | stop () |
Stop testing. More... | |
virtual bool | shouldStop () const |
Returns whether testing should be stopped. More... | |
virtual void | startTest (Test *test) |
Informs the result that a test will be started. More... | |
virtual void | addError (Test *test, Exception *e) |
Adds an error to the list of errors. More... | |
virtual void | addFailure (Test *test, Exception *e) |
Adds a failure to the list of failures. More... | |
virtual void | endTest (Test *test) |
Informs the result that a test was completed. More... | |
Protected Types | |
typedef std::deque< TestListener * > | TestListeners |
Protected Methods | |
void | addFailure (const TestFailure &failure) |
Called to add a failure to the list of failures. More... | |
Protected Attributes | |
TestListeners | m_listeners |
bool | m_stop |
Private Methods | |
TestResult (const TestResult &other) | |
TestResult & | operator= (const TestResult &other) |
A single instance of this class is used when running the test. It is usually created by the test runner (TestRunner).
This class shouldn't have to be inherited from. Use a TestListener or one of its subclasses to be informed of the ongoing tests. Use a Outputter to receive a test summary once it has finished
TestResult supplies a template method 'setSynchronizationObject()' so that subclasses can provide mutual exclusion in the face of multiple threads. This can be useful when tests execute in one thread and they fill a subclass of TestResult which effects change in another thread. To have mutual exclusion, override setSynchronizationObject() and make sure that you create an instance of ExclusiveZone at the beginning of each method.
|
|
|
Construct a TestResult.
|
|
Destroys a test result.
|
|
|
|
Adds an error to the list of errors. The passed in exception caused the error |
|
Called to add a failure to the list of failures.
Reimplemented in CppUnit::TextTestResult. |
|
Adds a failure to the list of failures. The passed in exception caused the failure. |
|
|
|
Informs the result that a test was completed.
|
|
|
|
|
|
Resets the result for a new run. Clear the previous run result. |
|
Returns whether testing should be stopped.
|
|
Informs the result that a test will be started.
Reimplemented in CppUnit::TextTestResult. |
|
Stop testing.
|
|
|
|
|
hosts this site. |
Send comments to: CppUnit Developers |