Test event reporter. More...

#include <cxxtools/unit/reporter.h>

Inheritance diagram for cxxtools::unit::Reporter:
cxxtools::unit::BriefReporter cxxtools::unit::JsonReporter

Public Member Functions

virtual ~Reporter ()
 Destructor.
virtual void reportStart (const TestContext &)
 Start notification.
virtual void reportFinish (const TestContext &)
 Finished notification.
virtual void reportMessage (const std::string &)
 Message notification.
virtual void reportSuccess (const TestContext &)
 Success notification.
virtual void reportAssertion (const TestContext &, const Assertion &)
 Assertion notification.
virtual void reportException (const TestContext &, const std::exception &)
 Exception notification.
virtual void reportError (const TestContext &)
 Error notification.
virtual void reportSkip (const TestContext &)
 Skipped notification.

Public Attributes

Signal< Reporter & > destroyed

Protected Member Functions

 Reporter ()
 Constructs a reporter.

Detailed Description

Test event reporter.

This class is the base class for all reporters for test events. It lets the implementor override several virtual methods that are called on perticular events during the test. Reporters can be made to print information to the console or write XML logs.

Constructor & Destructor Documentation

virtual cxxtools::unit::Reporter::~Reporter ( )
inlinevirtual

Destructor.

cxxtools::unit::Reporter::Reporter ( )
inlineprotected

Constructs a reporter.

Member Function Documentation

virtual void cxxtools::unit::Reporter::reportAssertion ( const TestContext ,
const Assertion  
)
inlinevirtual

Assertion notification.

This method is called when a an assertion failed during a test. an assertion fails when a user defined condition is not met.

Parameters
testThe failed test

Reimplemented in cxxtools::unit::BriefReporter, and cxxtools::unit::JsonReporter.

virtual void cxxtools::unit::Reporter::reportError ( const TestContext )
inlinevirtual

Error notification.

This method is called when a an unknown error occurs during a test.

Parameters
testThe failed test

Reimplemented in cxxtools::unit::BriefReporter, and cxxtools::unit::JsonReporter.

virtual void cxxtools::unit::Reporter::reportException ( const TestContext ,
const std::exception &   
)
inlinevirtual

Exception notification.

This method is called when a an exception failed during a test. An exception usually means that an error occured that was even u nexpected in a test scenario

Parameters
testThe failed test

Reimplemented in cxxtools::unit::BriefReporter, and cxxtools::unit::JsonReporter.

virtual void cxxtools::unit::Reporter::reportFinish ( const TestContext )
inlinevirtual

Finished notification.

This method is called when a test has finished. Every test sends this signal at its end no matter if it failed or succeeded.

Parameters
testThe finished test

Reimplemented in cxxtools::unit::BriefReporter, and cxxtools::unit::JsonReporter.

virtual void cxxtools::unit::Reporter::reportMessage ( const std::string &  )
inlinevirtual

Message notification.

This method is called when a test has produced an informational message.

Parameters
msgThe message

Reimplemented in cxxtools::unit::BriefReporter, and cxxtools::unit::JsonReporter.

virtual void cxxtools::unit::Reporter::reportSkip ( const TestContext )
inlinevirtual

Skipped notification.

This method is called when was skipped.

Parameters
testThe skipped test

Reimplemented in cxxtools::unit::BriefReporter, and cxxtools::unit::JsonReporter.

virtual void cxxtools::unit::Reporter::reportStart ( const TestContext )
inlinevirtual

Start notification.

This method is called when a test has started. Every test sends this signal at startup.

Parameters
testThe started test

Reimplemented in cxxtools::unit::BriefReporter, and cxxtools::unit::JsonReporter.

virtual void cxxtools::unit::Reporter::reportSuccess ( const TestContext )
inlinevirtual

Success notification.

This method is called when a test was successful.

Parameters
testThe succeeded test

Reimplemented in cxxtools::unit::BriefReporter, and cxxtools::unit::JsonReporter.

Member Data Documentation

Signal<Reporter&> cxxtools::unit::Reporter::destroyed

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