Name

TestListener

Description

The class TestListener (see Figure C-25) defines an interface for observers to receive test progress notifications from a TestResult. The method TestResult::addListener( ) is used to register a TestListener.

TestListener belongs to the namespace CppUnit. It is declared in TestListener.h, which also provides its default empty implementation.

The class TestListener
Figure C-25. The class TestListener

Declaration

class TestListener

Constructors/Destructors

virtual ~TestListener( )

A destructor.

Public Methods

virtual void addFailure(const TestFailure &failure)

A method called to notify the TestListener that a failure has occurred. The argument failure is a temporary object that is deleted after the call.

virtual void endTest(Test *test)

A method called to notify the TestListener that test has ended.

virtual void startTest(Test *test)

A method called to notify the TestListener that test is about to be run.

Protected/Private Methods

None.

Attributes

None.

Get Unit Test Frameworks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.