The documentation for the internal components of boost :: test may be a little inadequate, and it says that everything is available.
Look at the boost :: test header files, in particular for the test_suite and test_unit classes. There is a function called traverse_test_tree that can be used to pass registered tests.
Below is some samle code that I wrote to display the test results in a specific format, it uses traverse_test_tree to display the result of each test, I hope that it gives you a start.
class CppUnitOpFormatter : public boost::unit_test::output::plain_report_formatter { public: virtual void do_confirmation_report( boost::unit_test::test_unit const& tu, std::ostream& ostr ); }; class CppUnitSuiteVisitor : public test_tree_visitor { public: explicit CppUnitSuiteVisitor( const string& name ) : name_( name ) {} virtual void visit( const test_case& tu ) { const test_results& tr = results_collector.results( tu.p_id ); cout << name_ << "::" << tu.p_name << " : " << ( tr.passed() ? "OK\n" : "FAIL\n" ); } private: string name_; };
source share