CppTest  Version 2.0.0
Public Types | Public Member Functions | List of all members
Test::TextOutput Class Reference

#include <cpptest-textoutput.h>

Inheritance diagram for Test::TextOutput:
Test::Output

Public Types

enum  Mode { Terse, Verbose }
 

Public Member Functions

 TextOutput (Mode mode, std::ostream &stream=std::cout)
 
virtual void finished (int tests, const Time &time)
 
virtual void suite_start (int tests, const std::string &name)
 
virtual void suite_end (int tests, const std::string &name, const Time &time)
 
virtual void test_end (const std::string &name, bool ok, const Time &time)
 
virtual void assertment (const Source &s)
 
- Public Member Functions inherited from Test::Output
virtual ~Output ()
 
virtual void initialize (int tests)
 
virtual void test_start (const std::string &name)
 

Additional Inherited Members

- Protected Member Functions inherited from Test::Output
 Output ()
 

Detailed Description

Text output handler that outputs to the a stream.

Test suite output handler that writes its information as text to a a stream. It it possible to select between two different operational modes that controls the detail level, see Mode.

Member Enumeration Documentation

◆ Mode

Output mode.

Enumerator
Terse 

Terse output mode, which only shows the number of correct tests.

Verbose 

Verbose output mode, which also shows extended assert information for each test that failed.

Constructor & Destructor Documentation

◆ TextOutput()

Test::TextOutput::TextOutput ( Mode  mode,
std::ostream &  stream = std::cout 
)

Constructs a text output handler.

Parameters
modeOutput mode.
streamStream to output to.

Member Function Documentation

◆ finished()

void Test::TextOutput::finished ( int  tests,
const Time time 
)
virtual

Called when testing is finished.

Parameters
testsTotal number of tests in all suites.
timeTotal elapsed time for all tests.

Reimplemented from Test::Output.

◆ suite_start()

void Test::TextOutput::suite_start ( int  tests,
const std::string &  name 
)
virtual

Called when a suite is entered.

Parameters
testsNumber of tests in this suite.
nameName of the suite.

Reimplemented from Test::Output.

◆ suite_end()

void Test::TextOutput::suite_end ( int  tests,
const std::string &  name,
const Time time 
)
virtual

Called when a suite is finished.

Parameters
testsNumber of tests in this suite.
nameName of the suite.
timeTotal elapsed time for all tests in this suite.

Reimplemented from Test::Output.

References Verbose.

◆ test_end()

void Test::TextOutput::test_end ( const std::string &  name,
bool  ok,
const Time time 
)
virtual

Called when a test if finished, regardless if an assertment was issued.

Parameters
nameName of the test function.
okTrue if the test was successful; false otherwise.
timeExecution time.

Reimplemented from Test::Output.

◆ assertment()

void Test::TextOutput::assertment ( const Source s)
virtual

Called when an assertment is issued.

Parameters
sAssert point information.

Reimplemented from Test::Output.


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