...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::unit_test::output::compiler_log_formatter
// In header: <boost/test/output/compiler_log_formatter.hpp> class compiler_log_formatter : public boost::unit_test::unit_test_log_formatter { public: // public member functions virtual void log_start(std::ostream &, counter_t); virtual void log_finish(std::ostream &); virtual void log_build_info(std::ostream &); virtual void test_unit_start(std::ostream &, test_unit const &); virtual void test_unit_finish(std::ostream &, test_unit const &, unsigned long); virtual void test_unit_skipped(std::ostream &, test_unit const &, const_string); virtual void log_exception_start(std::ostream &, log_checkpoint_data const &, execution_exception const &); virtual void log_exception_finish(std::ostream &); virtual void log_entry_start(std::ostream &, log_entry_data const &, log_entry_types); virtual void log_entry_value(std::ostream &, const_string); virtual void log_entry_value(std::ostream &, lazy_ostream const &); virtual void log_entry_finish(std::ostream &); virtual void entry_context_start(std::ostream &, log_level); virtual void log_entry_context(std::ostream &, const_string); virtual void entry_context_finish(std::ostream &); virtual void test_unit_skipped(std::ostream &, test_unit const &); // protected member functions virtual void print_prefix(std::ostream &, const_string, std::size_t); };
compiler_log_formatter
public member functionsvirtual void log_start(std::ostream & os, counter_t test_cases_amount);Invoked at the beginning of test module execution.
See Also:
log_finish
Parameters: |
|
virtual void log_finish(std::ostream & os);Invoked at the end of test module execution.
See Also:
log_start
Parameters: |
|
virtual void log_build_info(std::ostream & os);Invoked when Unit Test Framework build information is requested.
Parameters: |
|
virtual void test_unit_start(std::ostream & os, test_unit const & tu);Invoked when test unit starts (either test suite or test case)
See Also:
test_unit_finish
Parameters: |
|
virtual void test_unit_finish(std::ostream & os, test_unit const & tu, unsigned long elapsed);Invoked when test unit finishes.
See Also:
test_unit_start
Parameters: |
|
virtual void test_unit_skipped(std::ostream & os, test_unit const & tu, const_string reason);Invoked if test unit skipped for any reason.
Parameters: |
|
virtual void log_exception_start(std::ostream & os, log_checkpoint_data const & lcd, execution_exception const & ex);Invoked when Unit Test Framework detects uncaught exception.
Call to this function starts uncaught exception report. It is going to followed by context information. Report is finalized by call to log_exception_finish.
See Also:
log_exception_finish
Parameters: |
|
virtual void log_exception_finish(std::ostream & os);Invoked when Unit Test Framework detects uncaught exception.
Call to this function finishes uncaught exception report.
See Also:
log_exception_start
Parameters: |
|
virtual void log_entry_start(std::ostream & os, log_entry_data const & led, log_entry_types let);Invoked by Unit Test Framework to start new log entry.
Call to this function starts new log entry. It is followed by series of log_entry_value calls and finally call to log_entry_finish. A log entry may consist of one or more values being reported. Some of these values will be plain strings, while others can be complicated expressions in a form of "lazy" expression template lazy_ostream.
See Also:
log_entry_value, log_entry_finish
Parameters: |
|
virtual void log_entry_value(std::ostream & os, const_string value);Invoked by Unit Test Framework to report a log entry content.
This is one of two overloaded methods to report log entry content. This one is used to report plain string value.
See Also:
log_entry_start, log_entry_finish
Parameters: |
|
virtual void log_entry_value(std::ostream & os, lazy_ostream const & value);Invoked by Unit Test Framework to report a log entry content.
This is one of two overloaded methods to report log entry content. This one is used to report some complicated expression passed as an expression template lazy_ostream. In most cases default implementation provided by the framework should work as is (it just converts the lazy expression into a string.
See Also:
log_entry_start, log_entry_finish
Parameters: |
|
virtual void log_entry_finish(std::ostream & os);Invoked by Unit Test Framework to finish a log entry report.
See Also:
log_entry_start, log_entry_start
Parameters: |
|
virtual void entry_context_start(std::ostream & os, log_level l);Invoked by Unit Test Framework to start log entry context report.
Unit Test Framework logs for failed assertions and uncaught exceptions context if one was defined by a test module. Context consists of multiple "scopes" identified by description messages assigned by the test module using BOOST_TEST_INFO/BOOST_TEST_CONTEXT statements.
See Also:
log_entry_context, entry_context_finish
Parameters: |
|
virtual void log_entry_context(std::ostream & os, const_string value);Invoked by Unit Test Framework to report log entry context "scope" description.
Each "scope" description is reported by separate call to log_entry_context.
See Also:
log_entry_start, entry_context_finish
Parameters: |
|
virtual void entry_context_finish(std::ostream & os);Invoked by Unit Test Framework to finish log entry context report.
See Also:
log_entry_start, entry_context_context
Parameters: |
|
virtual void test_unit_skipped(std::ostream & os, test_unit const & tu);Deprecated version of this interface.