31 std::wstring widen (
const std::string& s);
32 inline void ODS (std::stringstream& ss) {
33 OutputDebugString (widen (ss.str ()).c_str ());
36 inline void ODS (std::stringstream& ss) {
37 OutputDebugString (ss.str ().c_str());
52 ss <<
"Suite starting: " << suite.
name << std::endl;
64 ss <<
"Test starting: " << test.
test_name () << std::endl;
75 ss <<
"Test finished: " << test.
test_name () << std::endl;
88 ss <<
"Suite finishing: " << suite.
name << std::endl;
104 std::stringstream ss;
118 << failure.
message << std::endl;
130 using namespace std::chrono;
132 std::stringstream ss;
148 ss.setf (std::ios::fixed);
149 auto total_time_s = duration_cast<duration<float, std::chrono::seconds::period>>(
total_time);
150 ss <<
"Run time: " << std::setprecision (2) << total_time_s.count();
159std::wstring ReporterDbgout::widen (
const std::string& s)
161 int nsz = (int)s.size ();
162 int wsz = MultiByteToWideChar (CP_UTF8, 0, s.c_str (), nsz, 0, 0);
163 std::wstring out (wsz, 0);
165 MultiByteToWideChar (CP_UTF8, 0, s.c_str (), nsz, &out[0], wsz);
A Reporter that sends messages to debug output.
Definition reporter_dbgout.h:20
void SuiteStart(const TestSuite &suite) override
If tracing is enabled, show a suite start message.
Definition reporter_dbgout.h:45
void TestStart(const Test &test) override
If tracing is enabled, show a test start message.
Definition reporter_dbgout.h:58
void ReportFailure(const Failure &failure) override
Definition reporter_dbgout.h:102
int Summary() override
Definition reporter_dbgout.h:128
int SuiteFinish(const TestSuite &suite) override
If tracing is enabled, show a suite finish message.
Definition reporter_dbgout.h:83
void TestFinish(const Test &test) override
If tracing is enabled, show a test finish message.
Definition reporter_dbgout.h:70
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
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.