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 std::stringstream ss;
146 ss.setf (std::ios::fixed);
147 ss <<
"Run time: " << std::setprecision (2) <<
total_time_msec / 1000.;
156std::wstring ReporterDbgout::widen (
const std::string& s)
158 int nsz = (int)s.size ();
159 int wsz = MultiByteToWideChar (CP_UTF8, 0, s.c_str (), nsz, 0, 0);
160 std::wstring out (wsz, 0);
162 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:317
virtual void SuiteStart(const TestSuite &suite)
Invoked at the beginning of a test suite.
Definition utpp.h:581
virtual void TestStart(const Test &test)
Invoked at the beginning of a test.
Definition utpp.h:588
bool trace
true if tracing is enabled
Definition utpp.h:321
virtual void TestFinish(const Test &test)
Invoked at the end of a test.
Definition utpp.h:600
int total_test_count
total number of tests
Definition utpp.h:315
virtual void ReportFailure(const Failure &failure)
Called when a test has failed.
Definition utpp.h:595
virtual int Summary()
Generate results report.
Definition utpp.h:304
int total_failed_count
total number of failed tests
Definition utpp.h:316
virtual int SuiteFinish(const TestSuite &suite)
Invoked at the end of a test suite.
Definition utpp.h:617
int total_time_msec
total running time in milliseconds
Definition utpp.h:318
Representation of a test case.
Definition utpp.h:240
const std::string & test_name() const
Return test name.
Definition utpp.h:544
std::string name
Suite name.
Definition utpp.h:389
The failure object records the file name, the line number and a message.
Definition utpp.h:271
int line_number
Line number where the failure has occurred.
Definition utpp.h:274
std::string message
Description of failure.
Definition utpp.h:273
std::string filename
Name of file where a failure has occurred.
Definition utpp.h:272
#define DEFAULT_SUITE
Name of default suite.
Definition utpp.h:54
Test * CurrentTest
Currently executing test.
std::string CurrentSuite
Name of currently running suite.