dodo
0.0.1
A C++ library to create containerized Linux services
|
23 #include <common/unittest.hpp>
27 UnitTest::UnitTest(
const std::string& name,
const std::string& description, std::ostream *out ) :
29 description_(description),
43 *
out_ << std::string( 80,
'=' ) << std::endl;
45 *
out_ << std::string( 80,
'=' ) << std::endl;
50 *
out_ << std::string( 80,
'+' ) << std::endl;
58 *
out_ << std::string( 80,
'-' ) << std::endl;
59 *
out_ << name <<
" - " << description <<
" : " << (passed?
"passed":
"failure") << std::endl;
60 *
out_ << std::string( 80,
'-' ) << std::endl;
virtual void doRun()=0
Virtual to implement the test.
std::string name_
The test name.
size_t failed_
The total number of failed tests.
void writeUnitTestHeader()
Write the header.
Common and utility interfaces.
bool writeSubTestResult(const std::string &name, const std::string &description, bool passed)
Write the subtest result.
size_t total_
The total number of tests.
std::string description_
The test description.
UnitTest(const std::string &name, const std::string &description, std::ostream *out)
Create a test.
void writeUnitTestSummary()
Write the summary.
std::ostream * out_
The output destination.