unittest::UnitTestPrint class

UnitTestPrint : tk::Print.

Base classes

class tk::Print

Constructors, destructors, conversion operators

UnitTestPrint(std::ostream& str = std::clog, std::ostream& qstr = std::cout) explicit

Public functions

void unithead(const std::string& t, const std::string& group) const
void test(std::size_t ncomplete, std::size_t nfail, const std::vector<std::string>& status)

Function documentation

unittest::UnitTestPrint::UnitTestPrint(std::ostream& str = std::clog, std::ostream& qstr = std::cout) explicit

Parameters
str in/out Verbose stream
qstr in/out Quiet stream

Constructor

void unittest::UnitTestPrint::unithead(const std::string& t, const std::string& group) const

Parameters
in Section title
group in String attempting to match unit test groups

Print unit tests header (with legend)

void unittest::UnitTestPrint::test(std::size_t ncomplete, std::size_t nfail, const std::vector<std::string>& status)

Print one-liner info for test

Columns: [done/failed]

  • done: number of tests completed so far
  • failed: number of failed tests so far name of the test group name of the test result (with additional info if failed) Assumed fields for status:
  • status[0]: test group name
  • status[1]: test name
  • status[2]: result (tut::test_result::result_type as string)
  • status[3]: exception message for failed test
  • status[4]: exception type id for failed test