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

A Reporter that keeps a list of test results. More...

#include <utpp.h>

Inheritance diagram for UnitTest::ReporterDeferred:
UnitTest::Reporter UnitTest::ReporterXml

Classes

struct  TestResult
 Test results including all failure messages More...
 

Public Member Functions

void SuiteStart (const TestSuite &suite) override
 
void TestStart (const Test &test) override
 
void ReportFailure (const Failure &failure) override
 
void TestFinish (const Test &test) override
 
void Clear () override
 Reset all statistics.
 
- Public Member Functions inherited from UnitTest::Reporter
void SetTrace (bool on_off)
 Controls test tracing feature.
 
virtual int SuiteFinish (const TestSuite &suite)
 Invoked at the end of a test suite.
 
virtual int Summary ()
 Generate results report.
 

Protected Attributes

std::deque< TestResultresults
 Results of all tests.
 
- Protected Attributes inherited from UnitTest::Reporter
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

A Reporter that keeps a list of test results.

Member Function Documentation

◆ Clear()

void UnitTest::ReporterDeferred::Clear ( )
inlineoverridevirtual

Reset all statistics.

Reimplemented from UnitTest::Reporter.

Reimplemented in UnitTest::ReporterXml.

◆ ReportFailure()

void UnitTest::ReporterDeferred::ReportFailure ( const Failure & failure)
inlineoverridevirtual

Add a new failure to current test

Parameters
failureThe failure record

Reimplemented from UnitTest::Reporter.

◆ SuiteStart()

void UnitTest::ReporterDeferred::SuiteStart ( const TestSuite & suite)
inlineoverridevirtual

Called at the beginning of a new suite.

Parameters
suiteNew suite name

Creates a new TestResult object with an empty test name as a suite start flag. Adds the TestResult object it to the results container.

Reimplemented from UnitTest::Reporter.

◆ TestFinish()

void UnitTest::ReporterDeferred::TestFinish ( const Test & test)
inlineoverridevirtual

Store test runtime when the test finishes

Parameters
testTest that is about to end

Reimplemented from UnitTest::Reporter.

◆ TestStart()

void UnitTest::ReporterDeferred::TestStart ( const Test & test)
inlineoverridevirtual

Called at the beginning of a new test.

Parameters
testTest that is about to start

Creates a new TestResult object and adds it to the results container

Reimplemented from UnitTest::Reporter.


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