17#ifndef WIN32_LEAN_AND_MEAN
18#define WIN32_LEAN_AND_MEAN
19#define UTPP_MUST_UNDEF_LEAN_AND_MEAN
24#define UTPP_MUST_UNDEF_NOMINMAX
29#ifdef UTPP_MUST_UNDEF_NOMINMAX
33#ifdef UTPP_MUST_UNDEF_LEAN_AND_MEAN
34#undef WIN32_LEAN_AND_MEAN
37#undef UTPP_MUST_UNDEF_LEAN_AND_MEAN
38#undef UTPP_MUST_UNDEF_NOMINMAX
56 std::wstring widen (
const std::string& s);
57 inline void ODS (std::stringstream& ss) {
58 OutputDebugString (widen (ss.str ()).c_str ());
61 inline void ODS (std::stringstream& ss) {
62 OutputDebugString (ss.str ().c_str());
77 ss <<
"Suite starting: " << suite.
name << std::endl;
89 ss <<
"Test starting: " << test.
test_name () << std::endl;
100 ss <<
"Test finished: " << test.
test_name () << std::endl;
112 std::stringstream ss;
113 ss <<
"Suite finishing: " << suite.
name << std::endl;
129 std::stringstream ss;
143 << failure.
message << std::endl;
155 using namespace std::chrono;
157 std::stringstream ss;
173 ss.setf (std::ios::fixed);
174 auto total_time_s = duration_cast<duration<float, std::chrono::seconds::period>>(
total_time);
175 ss <<
"Run time: " << std::setprecision (2) << total_time_s.count();
184std::wstring ReporterDbgout::widen (
const std::string& s)
186 int nsz = (int)s.size ();
187 int wsz = MultiByteToWideChar (CP_UTF8, 0, s.c_str (), nsz, 0, 0);
188 std::wstring out (wsz, 0);
190 MultiByteToWideChar (CP_UTF8, 0, s.c_str (), nsz, &out[0], wsz);
A Reporter that sends messages to debug output.
Definition reporter_dbgout.h:45
void SuiteStart(const TestSuite &suite) override
If tracing is enabled, show a suite start message.
Definition reporter_dbgout.h:70
void TestStart(const Test &test) override
If tracing is enabled, show a test start message.
Definition reporter_dbgout.h:83
void ReportFailure(const Failure &failure) override
Definition reporter_dbgout.h:127
int Summary() override
Definition reporter_dbgout.h:153
int SuiteFinish(const TestSuite &suite) override
If tracing is enabled, show a suite finish message.
Definition reporter_dbgout.h:108
void TestFinish(const Test &test) override
If tracing is enabled, show a test finish message.
Definition reporter_dbgout.h:95
int total_failures_count
total number of failures
Definition utpp.h:320
virtual void SuiteStart(const TestSuite &suite)
Invoked at the beginning of a test suite.
Definition utpp.h:583
virtual void TestStart(const Test &test)
Invoked at the beginning of a test.
Definition utpp.h:590
std::chrono::milliseconds total_time
total running time in milliseconds
Definition utpp.h:321
bool trace
true if tracing is enabled
Definition utpp.h:324
virtual void TestFinish(const Test &test)
Invoked at the end of a test.
Definition utpp.h:602
int total_test_count
total number of tests
Definition utpp.h:318
virtual void ReportFailure(const Failure &failure)
Called when a test has failed.
Definition utpp.h:597
virtual int Summary()
Generate results report.
Definition utpp.h:307
int total_failed_count
total number of failed tests
Definition utpp.h:319
virtual int SuiteFinish(const TestSuite &suite)
Invoked at the end of a test suite.
Definition utpp.h:619
Representation of a test case.
Definition utpp.h:243
const std::string & test_name() const
Return test name.
Definition utpp.h:546
std::string name
Suite name.
Definition utpp.h:392
The failure object records the file name, the line number and a message.
Definition utpp.h:274
int line_number
Line number where the failure has occurred.
Definition utpp.h:277
std::string message
Description of failure.
Definition utpp.h:276
std::string filename
Name of file where a failure has occurred.
Definition utpp.h:275
#define DEFAULT_SUITE
Name of default suite.
Definition utpp.h:64
Test * CurrentTest
Currently executing test.
std::string CurrentSuite
Name of currently running suite.