55 out <<
"Begin suite: " << suite.
name << std::endl;
65 out <<
"Start test: " << test.
test_name () << std::endl;
73 std::cout <<
"End test: " << test.
test_name () << std::endl;
82 out <<
"End suite: " << suite.
name << std::endl;
104#if defined(__APPLE__) || defined(__GNUG__)
106 << failure.
message << std::endl;
109 << failure.
message << std::endl;
121 using namespace std::chrono;
127 <<
" failures)." << std::endl;
130 out << std::dec <<
"Success: " <<
total_test_count <<
" tests passed." << std::endl;
132 auto total_time_s = duration_cast<duration<float, std::chrono::seconds::period>>(
total_time);
133 out.setf (std::ios::fixed);
134 out <<
"Run time: " << std::setprecision (2) << total_time_s.count() <<
" seconds" << std::endl;
int total_failures_count
total number of failures
Definition utpp.h:322
virtual void SuiteStart(const TestSuite &suite)
Invoked at the beginning of a test suite.
Definition utpp.h:585
virtual void TestStart(const Test &test)
Invoked at the beginning of a test.
Definition utpp.h:592
std::chrono::milliseconds total_time
total running time in milliseconds
Definition utpp.h:323
bool trace
true if tracing is enabled
Definition utpp.h:326
virtual void TestFinish(const Test &test)
Invoked at the end of a test.
Definition utpp.h:604
int total_test_count
total number of tests
Definition utpp.h:320
virtual void ReportFailure(const Failure &failure)
Called when a test has failed.
Definition utpp.h:599
virtual int Summary()
Generate results report.
Definition utpp.h:309
int total_failed_count
total number of failed tests
Definition utpp.h:321
virtual int SuiteFinish(const TestSuite &suite)
Invoked at the end of a test suite.
Definition utpp.h:621
void TestFinish(const Test &test) override
If tracing is enabled, show a test finish message.
Definition reporter_stream.h:70
int Summary() override
Definition reporter_stream.h:119
ReporterStream(std::ostream &strm=std::cout)
Definition reporter_stream.h:43
void ReportFailure(const Failure &failure) override
Definition reporter_stream.h:94
void TestStart(const Test &test) override
If tracing is enabled, show a test start message.
Definition reporter_stream.h:60
int SuiteFinish(const TestSuite &suite) override
If tracing is enabled, show a suite finish message.
Definition reporter_stream.h:79
void SuiteStart(const TestSuite &suite) override
If tracing is enabled, show a suite start message.
Definition reporter_stream.h:50
Representation of a test case.
Definition utpp.h:245
const std::string & test_name() const
Return test name.
Definition utpp.h:548
std::string name
Suite name.
Definition utpp.h:394
The failure object records the file name, the line number and a message.
Definition utpp.h:276
int line_number
Line number where the failure has occurred.
Definition utpp.h:279
std::string message
Description of failure.
Definition utpp.h:278
std::string filename
Name of file where a failure has occurred.
Definition utpp.h:277
#define DEFAULT_SUITE
Name of default suite.
Definition utpp.h:59
Test * CurrentTest
Currently executing test.
std::string CurrentSuite
Name of currently running suite.