CppUnit - The Unit Testing Library

CppUnit project page | FAQ

Public Member Functions | List of all members
TextTestResult Class Reference
Tracking test execution

Holds printable test result (DEPRECATED). More...

`#include <TextTestResult.h>`

Inheritance diagram for TextTestResult:
[legend]
Collaboration diagram for TextTestResult:
[legend]

## Public Member Functions
| TextTestResult ()
virtual void | addFailure (const TestFailure &failure)
| Called when a failure occurs while running a test.
virtual void | startTest (Test *test)
| Informs TestListener that a test will be started.
virtual void | print (OStream &stream)
virtual void | addFailure (Test *test, Exception *e)
| Adds a failure to the list of failures. The passed in exception caused the failure.
Public Member Functions inherited from TestResult
| TestResult (SynchronizationObject *syncObject=0)
| Construct a TestResult.
virtual | ~TestResult ()
| Destroys a test result.
virtual void | addListener (TestListener *listener)
virtual void | removeListener (TestListener *listener)
virtual void | reset ()
| Resets the stop flag.
virtual void | stop ()
| Stop testing.
virtual bool | shouldStop () const
| Returns whether testing should be stopped.
virtual void | addError (Test *test, Exception *e)
| Adds an error to the list of errors. The passed in exception caused the error.
virtual void | endTest (Test *test)
| Informs TestListener that a test was completed.
virtual void | startSuite (Test *test)
| Informs TestListener that a test suite will be started.
virtual void | endSuite (Test *test)
| Informs TestListener that a test suite was completed.
virtual void | runTest (Test *test)
| Run the specified test.
virtual bool | protect (const Functor &functor, Test *test, const std::string &shortDescription=std::string(""))
| Protects a call to the specified functor.
virtual void | pushProtector (Protector *protector)
| Adds the specified protector to the protector chain.
virtual void | popProtector ()
| Removes the last protector from the protector chain.
Public Member Functions inherited from TestResultCollector
| TestResultCollector (SynchronizationObject *syncObject=0)
virtual | ~TestResultCollector ()
| Destructor.
virtual void | reset ()
virtual int | runTests () const
| Gets the number of run tests.
virtual int | testErrors () const
| Gets the number of detected errors (uncaught exception).
virtual int | testFailures () const
| Gets the number of detected failures (failed assertion).
virtual int | testFailuresTotal () const
| Gets the total number of detected failures.
virtual const TestFailures & | failures () const
| Returns a the list failures (random access collection).
virtual const Tests & | tests () const
Public Member Functions inherited from TestSuccessListener
| TestSuccessListener (SynchronizationObject *syncObject=0)
virtual | ~TestSuccessListener ()
| Destructor.
virtual bool | wasSuccessful () const
| Returns whether the entire test was successful or not.
Public Member Functions inherited from TestListener
virtual | ~TestListener ()
virtual void | endTest (Test *)
| Called just after a TestCase was run (even if a failure occured).
virtual void | startSuite (Test *)
| Called by a TestComposite just before running its child tests.
virtual void | endSuite (Test *)
| Called by a TestComposite after running its child tests.
virtual void | startTestRun (Test *, TestResult *)
| Called by a TestRunner before running the test.
virtual void | endTestRun (Test *, TestResult *)
| Called by a TestRunner after running the test.

## Additional Inherited Members
Public Types inherited from TestResultCollector
typedef std::deque< TestFailure * > | TestFailures
typedef std::deque< Test * > | Tests
Protected Types inherited from TestResult
typedef std::deque< TestListener * > | TestListeners
Protected Member Functions inherited from TestResult
void | addFailure (const TestFailure &failure)
| Called to add a failure to the list of failures.
virtual void | startTestRun (Test *test)
virtual void | endTestRun (Test *test)
Protected Member Functions inherited from SynchronizedObject
virtual void | setSynchronizationObject (SynchronizationObject *syncObject)
| Accept a new synchronization object for protection of this instance TestResult assumes ownership of the object.
| SynchronizedObject (SynchronizationObject *syncObject=0)
virtual | ~SynchronizedObject ()
| Destructor.
Protected Member Functions inherited from TestResultCollector
void | freeFailures ()
Protected Attributes inherited from TestResult
TestListeners | m_listeners
ProtectorChain * | m_protectorChain
bool | m_stop
Protected Attributes inherited from SynchronizedObject
SynchronizationObject * | m_syncObject
Protected Attributes inherited from TestResultCollector
Tests | m_tests
TestFailures | m_failures
int | m_testErrors

## Detailed Description

Holds printable test result (DEPRECATED).

deprecated Use class TextTestProgressListener and TextOutputter instead.

## Constructor & Destructor Documentation

## ◆ TextTestResult()

CPPUNIT_NS_BEGIN TextTestResult::TextTestResult | ( |  | ) |

## Member Function Documentation

## ◆ addFailure() [1/2]

void TextTestResult::addFailure | ( | const TestFailure & |  | ) |
| 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 from TestResultCollector.

## ◆ addFailure() [2/2]

void TestResult::addFailure | ( | Test * | test,
|  | Exception * | e )
| virtual

Adds a failure to the list of failures. The passed in exception caused the failure.

Reimplemented from TestResult.

## ◆ print()

void TextTestResult::print | ( | OStream & | stream | ) |
| virtual

## ◆ startTest()

void TextTestResult::startTest | ( | Test * | test | ) |
| virtual

Informs TestListener that a test will be started.

Reimplemented from TestResult.

The documentation for this class was generated from the following files:

- TextTestResult.h
- TextTestResult.cpp

| Send comments to: CppUnit Developers