BitShift Validate 0.1.0
BitShift Validate API Reference Documentation
Loading...
Searching...
No Matches
bitshift::validate::ostream_reporter Class Reference

#include <bitshift/validate/reporting.hxx>

Inheritance diagram for bitshift::validate::ostream_reporter:
bitshift::validate::reporter

Public Member Functions

 ostream_reporter (ostream &os, bool show_file, bool show_line)
 ostream_reporter (ostream_reporter const &)=delete
 ostream_reporter (ostream_reporter &&)=delete
 ~ostream_reporter () noexcept override
ostream & output ()
ostream_reporteroperator= (ostream_reporter const &)=delete
ostream_reporteroperator= (ostream_reporter &&)=delete
Public Member Functions inherited from bitshift::validate::reporter
virtual ~reporter () noexcept
proxy log_setup (string const &file, int line)
proxy log_teardown (string const &file, int line)
proxy log_test_case (string const &name, string const &description, string const &file, int line)
proxy log_failure (string message, string file, int line)
void log_summary (uint16_t total, uint16_t ignored, uint16_t pass, uint16_t fail)

Protected Member Functions

void do_log_setup (string const &file, int line, string const &detail) override
void do_log_teardown (string const &file, int line, string const &detail) override
void do_log_test_case (string const &name, string const &description, string const &file, int line, string const &detail) override
void do_log_failure (string const &message, string const &file, int line, string const &detail) override
void do_log_summary (uint16_t total, uint16_t ignored, uint16_t pass, uint16_t fail) override
Protected Member Functions inherited from bitshift::validate::reporter
 reporter ()
 reporter (reporter const &)=delete
 reporter (reporter &&)=delete
reporteroperator= (reporter const &)=delete
reporteroperator= (reporter &&)=delete

Detailed Description

Default ostream-based reporter.

Constructor & Destructor Documentation

◆ ostream_reporter() [1/3]

bitshift::validate::ostream_reporter::ostream_reporter ( ostream & os,
bool show_file,
bool show_line )

Constructor.

Parameters
osThe output stream.
show_fileInclude file information in output.
show_lineInclude line information in output.

◆ ostream_reporter() [2/3]

bitshift::validate::ostream_reporter::ostream_reporter ( ostream_reporter const & )
delete

Copy-construction is disabled.

◆ ostream_reporter() [3/3]

bitshift::validate::ostream_reporter::ostream_reporter ( ostream_reporter && )
delete

Move-construction is disabled.

◆ ~ostream_reporter()

bitshift::validate::ostream_reporter::~ostream_reporter ( )
overridenoexcept

Destructor.

Member Function Documentation

◆ output()

ostream & bitshift::validate::ostream_reporter::output ( )

Get a reference to the associated output stream.

◆ operator=() [1/2]

ostream_reporter & bitshift::validate::ostream_reporter::operator= ( ostream_reporter const & )
delete

Copy-assignment is disabled.

◆ operator=() [2/2]

ostream_reporter & bitshift::validate::ostream_reporter::operator= ( ostream_reporter && )
delete

Move-assignment is disabled.

◆ do_log_setup()

void bitshift::validate::ostream_reporter::do_log_setup ( string const & file,
int line,
string const & detail )
overrideprotectedvirtual

Log test suite setup execution.

Parameters
fileThe file in which the setup is defined.
lineThe line on which the setup is defined.
detailExtra details.

Implements bitshift::validate::reporter.

◆ do_log_teardown()

void bitshift::validate::ostream_reporter::do_log_teardown ( string const & file,
int line,
string const & detail )
overrideprotectedvirtual

Log test suite teardown execution.

Parameters
fileThe file in which the teardown is defined.
lineThe line on which the teardown is defined.
detailExtra details.

Implements bitshift::validate::reporter.

◆ do_log_test_case()

void bitshift::validate::ostream_reporter::do_log_test_case ( string const & name,
string const & description,
string const & file,
int line,
string const & detail )
overrideprotectedvirtual

Log test case execution.

Parameters
nameThe name of the test case.
descriptionA description of the test case.
fileThe file in which the test case is defined.
lineThe line on which the test case is defined.
detailExtra details.

Implements bitshift::validate::reporter.

◆ do_log_failure()

void bitshift::validate::ostream_reporter::do_log_failure ( string const & message,
string const & file,
int line,
string const & detail )
overrideprotectedvirtual

Log test case failure.

Parameters
messageA message describing the failure.
fileThe file in which the failure occurred.
lineThe line on which the error occurred.
detailExtra details.

Implements bitshift::validate::reporter.

◆ do_log_summary()

void bitshift::validate::ostream_reporter::do_log_summary ( uint16_t total,
uint16_t ignored,
uint16_t pass,
uint16_t fail )
overrideprotectedvirtual

Log test suite summary.

Parameters
totalThe total number of tests.
ignoredThe total number of ignored tests.
passThe total number of passed tests.
failThe total number of failed tests.

Implements bitshift::validate::reporter.