CppUnit - The Unit Testing Library

CppUnit project page | FAQ

Public Member Functions | Private Attributes | List of all members
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. More...
virtual void | reset ()
void | addFailure (const TestFailure &failure)
| Called when a failure occurs while running a test. More...
virtual bool | wasSuccessful () const
| Returns whether the entire test was successful or not. More...
Public Member Functions inherited from TestListener
virtual | ~TestListener ()
virtual void | startTest (Test *)
| Called when just before a TestCase is run. More...
virtual void | addFailure (const TestFailure &)
| Called when a failure occurs while running a test. More...
virtual void | endTest (Test *)
| Called just after a TestCase was run (even if a failure occured). More...
virtual void | startSuite (Test *)
| Called by a TestComposite just before running its child tests. More...
virtual void | endSuite (Test *)
| Called by a TestComposite after running its child tests. More...
virtual void | startTestRun (Test *, TestResult *)
| Called by a TestRunner before running the test. More...
virtual void | endTestRun (Test *, TestResult *)
| Called by a TestRunner after running the test. More...
Public Member Functions inherited from SynchronizedObject
| SynchronizedObject (SynchronizationObject *syncObject=0)
virtual | ~SynchronizedObject ()
| Destructor. More...

## 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. More...
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, and 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