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;
103 auto f = out.flags (std::ios::dec);
105#if defined(__APPLE__) || defined(__GNUG__)
107 << failure.
message << std::endl;
110 << failure.
message << std::endl;
123 using namespace std::chrono;
124 auto f = out.flags (std::ios::dec | std::ios::fixed);
125 auto p = out.precision (2);
131 <<
" failures)." << std::endl;
136 auto total_time_s = duration_cast<duration<float, std::chrono::seconds::period>>(
total_time);
137 out <<
"Run time: " << total_time_s.count() <<
" seconds" << std::endl;
int total_failures_count
total number of failures
Definition utpp.h:323
virtual void SuiteStart(const TestSuite &suite)
Invoked at the beginning of a test suite.
Definition utpp.h:586
virtual void TestStart(const Test &test)
Invoked at the beginning of a test.
Definition utpp.h:593
std::chrono::milliseconds total_time
total running time in milliseconds
Definition utpp.h:324
bool trace
true if tracing is enabled
Definition utpp.h:327
virtual void TestFinish(const Test &test)
Invoked at the end of a test.
Definition utpp.h:605
int total_test_count
total number of tests
Definition utpp.h:321
virtual void ReportFailure(const Failure &failure)
Called when a test has failed.
Definition utpp.h:600
virtual int Summary()
Generate results report.
Definition utpp.h:310
int total_failed_count
total number of failed tests
Definition utpp.h:322
virtual int SuiteFinish(const TestSuite &suite)
Invoked at the end of a test suite.
Definition utpp.h:622
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:121
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:246
const std::string & test_name() const
Return test name.
Definition utpp.h:549
std::string name
Suite name.
Definition utpp.h:395
The failure object records the file name, the line number and a message.
Definition utpp.h:277
int line_number
Line number where the failure has occurred.
Definition utpp.h:280
std::string message
Description of failure.
Definition utpp.h:279
std::string filename
Name of file where a failure has occurred.
Definition utpp.h:278
#define DEFAULT_SUITE
Name of default suite.
Definition utpp.h:60
Test * CurrentTest
Currently executing test.
std::string CurrentSuite
Name of currently running suite.