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

A Reporter that sends results directly to an output stream. More...

#include <reporter_stream.h>

Inheritance diagram for UnitTest::ReporterStream:
UnitTest::Reporter UnitTest::ReporterStdout

Public Member Functions

 ReporterStream (std::ostream &strm=std::cout)
 
- Public Member Functions inherited from UnitTest::Reporter
void SetTrace (bool on_off)
 Controls test tracing feature.
 
virtual void Clear ()
 Reset all statistics.
 

Protected Member Functions

void SuiteStart (const TestSuite &suite) override
 If tracing is enabled, show a suite start message.
 
void TestStart (const Test &test) override
 If tracing is enabled, show a test start message.
 
void TestFinish (const Test &test) override
 If tracing is enabled, show a test finish message.
 
int SuiteFinish (const TestSuite &suite) override
 If tracing is enabled, show a suite finish message.
 
void ReportFailure (const Failure &failure) override
 
int Summary () override
 

Protected Attributes

std::ostream & out
 
- 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 sends results directly to an output stream.

Constructor & Destructor Documentation

◆ ReporterStream()

UnitTest::ReporterStream::ReporterStream ( std::ostream & strm = std::cout)
inline

Constructor for a stream reporter.

Parameters
strmOutput stream

Member Function Documentation

◆ ReportFailure()

void UnitTest::ReporterStream::ReportFailure ( const Failure & failure)
inlineoverrideprotectedvirtual

Output a failure message. If a test is in progress (the normal case) the message includes the name of the test and suite.

Parameters
failure- the failure information (filename, line number and message)

Reimplemented from UnitTest::Reporter.

◆ SuiteFinish()

int UnitTest::ReporterStream::SuiteFinish ( const TestSuite & suite)
inlineoverrideprotectedvirtual

If tracing is enabled, show a suite finish message.

Reimplemented from UnitTest::Reporter.

◆ SuiteStart()

void UnitTest::ReporterStream::SuiteStart ( const TestSuite & suite)
inlineoverrideprotectedvirtual

If tracing is enabled, show a suite start message.

Reimplemented from UnitTest::Reporter.

◆ Summary()

int UnitTest::ReporterStream::Summary ( )
inlineoverrideprotectedvirtual

Prints a test run summary including number of tests, number of failures, running time, etc.

Reimplemented from UnitTest::Reporter.

◆ TestFinish()

void UnitTest::ReporterStream::TestFinish ( const Test & test)
inlineoverrideprotectedvirtual

If tracing is enabled, show a test finish message.

Reimplemented from UnitTest::Reporter.

◆ TestStart()

void UnitTest::ReporterStream::TestStart ( const Test & test)
inlineoverrideprotectedvirtual

If tracing is enabled, show a test start message.

Reimplemented from UnitTest::Reporter.


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