CppUnit - The Unit Testing Library

CppUnit project page | FAQ

TestSuccessListener Class Reference
Tracking test execution

TestListener that checks if any test case failed. More...

`#include <TestSuccessListener.h>`

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

## Public Member Functions
| TestSuccessListener (SynchronizationObject *syncObject=0)
virtual | ~TestSuccessListener ()
| Destructor.
virtual void | reset ()
void | addFailure (const TestFailure &failure)
| Called when a failure occurs while running a test.
virtual bool | wasSuccessful () const
| Returns whether the entire test was successful or not.
Public Member Functions inherited from TestListener
virtual | ~TestListener ()
virtual void | startTest (Test *)
| Called when just before a TestCase is run.
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.
Public Member Functions inherited from SynchronizedObject
| SynchronizedObject (SynchronizationObject *syncObject=0)
virtual | ~SynchronizedObject ()
| Destructor.

## Private Attributes
bool | m_success

## Additional Inherited Members
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.
Protected Attributes inherited from SynchronizedObject
SynchronizationObject * | m_syncObject

## Detailed Description

TestListener that checks if any test case failed.

## Constructor & Destructor Documentation

## ◆ TestSuccessListener()

CPPUNIT_NS_BEGIN TestSuccessListener::TestSuccessListener | ( | SynchronizationObject * | syncObject = 0 | ) |

Constructs a TestSuccessListener object.

## ◆ ~TestSuccessListener()

TestSuccessListener::~TestSuccessListener | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ addFailure()

void TestSuccessListener::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 TestListener.

Reimplemented in TextTestResult.

## ◆ reset()

void TestSuccessListener::reset | ( |  | ) |
| virtual

Reimplemented in TestResultCollector.

## ◆ wasSuccessful()

bool TestSuccessListener::wasSuccessful | ( |  | ) | const
| virtual

Returns whether the entire test was successful or not.

## Member Data Documentation

## ◆ m_success

bool TestSuccessListener::m_success
| private

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

- TestSuccessListener.h
- TestSuccessListener.cpp

| Send comments to: CppUnit Developers