UTPP
Loading...
Searching...
No Matches
UnitTest::Reporter Class Reference

Abstract base for all reporters. More...

#include <utpp.h>

Inheritance diagram for UnitTest::Reporter:
UnitTest::ReporterDbgout UnitTest::ReporterDeferred UnitTest::ReporterStream UnitTest::ReporterXml UnitTest::ReporterStdout

Public Member Functions

void SetTrace (bool on_off)
 Controls test tracing feature.
 
virtual void SuiteStart (const TestSuite &suite)
 Invoked at the beginning of a test suite.
 
virtual void TestStart (const Test &test)
 Invoked at the beginning of a test.
 
virtual void ReportFailure (const Failure &failure)
 Called when a test has failed.
 
virtual void TestFinish (const Test &test)
 Invoked at the end of a test.
 
virtual int SuiteFinish (const TestSuite &suite)
 Invoked at the end of a test suite.
 
virtual int Summary ()
 Generate results report.
 
virtual void Clear ()
 Reset all statistics.
 

Protected Attributes

int suite_test_count
 number of tests in suite
 
int suite_failed_count
 number of failed tests in suite
 
int suite_failures_count
 number of failures in suite
 
int suite_time_msec
 total suite running time in milliseconds
 
int total_test_count
 total number of tests
 
int total_failed_count
 total number of failed tests
 
int total_failures_count
 total number of failures
 
int total_time_msec
 total running time in milliseconds
 
int suites_count
 number of suites ran
 
bool trace
 true if tracing is enabled
 

Detailed Description

Abstract base for all reporters.

Member Function Documentation

◆ Clear()

void UnitTest::Reporter::Clear ( )
inlinevirtual

Reset all statistics.

Reimplemented in UnitTest::ReporterDeferred, and UnitTest::ReporterXml.

◆ ReportFailure()

void UnitTest::Reporter::ReportFailure ( const Failure & failure)
inlinevirtual

Called when a test has failed.

Reimplemented in UnitTest::ReporterDbgout, UnitTest::ReporterDeferred, and UnitTest::ReporterStream.

◆ SuiteFinish()

int UnitTest::Reporter::SuiteFinish ( const TestSuite & suite)
inlinevirtual

Invoked at the end of a test suite.

Returns
number of failures in this suite

Reimplemented in UnitTest::ReporterDbgout, and UnitTest::ReporterStream.

◆ SuiteStart()

void UnitTest::Reporter::SuiteStart ( const TestSuite & suite)
inlinevirtual

Invoked at the beginning of a test suite.

Records the beginning of a new test suite.

Reimplemented in UnitTest::ReporterDbgout, UnitTest::ReporterDeferred, and UnitTest::ReporterStream.

◆ Summary()

virtual int UnitTest::Reporter::Summary ( )
inlinevirtual

Generate results report.

Reimplemented in UnitTest::ReporterDbgout, UnitTest::ReporterStream, and UnitTest::ReporterXml.

◆ TestFinish()

void UnitTest::Reporter::TestFinish ( const Test & test)
inlinevirtual

Invoked at the end of a test.

Reimplemented in UnitTest::ReporterDbgout, UnitTest::ReporterDeferred, and UnitTest::ReporterStream.

◆ TestStart()

void UnitTest::Reporter::TestStart ( const Test & test)
inlinevirtual

Invoked at the beginning of a test.

Reimplemented in UnitTest::ReporterDbgout, UnitTest::ReporterDeferred, and UnitTest::ReporterStream.


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