Index: boost/test/impl/compiler_log_formatter.ipp =================================================================== --- boost/test/impl/compiler_log_formatter.ipp (revision 80690) +++ boost/test/impl/compiler_log_formatter.ipp (working copy) @@ -24,6 +24,7 @@ #include #include #include +#include // Boost #include @@ -53,6 +54,21 @@ : BOOST_TEST_L( "Test setup" ); } +//____________________________________________________________________________// + +void +print_result( std::ostream& ostr, counter_t v, counter_t total, + const_string name, const_string res ) +{ + if( v > 0 ) { + ostr << v << ' ' << name << ( v != 1 ? "s" : "" ); + if( total > 0 ) { + ostr << " out of " << total; + } + ostr << ' ' << res << ". "; + } +} + } // local namespace //____________________________________________________________________________// @@ -113,6 +129,40 @@ output << elapsed << "mks"; } + output << ". "; + + test_results const& tr = results_collector.results( tu.p_id ); + + const_string status; + + if( tr.passed() ) + status = "passed"; + else if( tr.p_skipped ) + status = "skipped"; + else if( tr.p_aborted ) + status = "aborted"; + else + status = "failed"; + + output << "Test " << ( tu.p_type == tut_case ? "case" : "suite" ) << ' ' << status << ". "; + + if( tr.p_skipped ) { + output << "due to " << ( tu.check_dependencies() ? "test aborting\n" : "failed dependency\n" ); + return; + } + + counter_t total_assertions = tr.p_assertions_passed + tr.p_assertions_failed; + counter_t total_tc = tr.p_test_cases_passed + tr.p_test_cases_failed + tr.p_test_cases_skipped; + + if( total_assertions > 0 || total_tc > 0 ) { + print_result( output, tr.p_assertions_passed, total_assertions, "assertion", "passed" ); + print_result( output, tr.p_assertions_failed, total_assertions, "assertion", "failed" ); + print_result( output, tr.p_expected_failures, 0 , "failure" , "expected" ); + print_result( output, tr.p_test_cases_passed, total_tc , "test case", "passed" ); + print_result( output, tr.p_test_cases_failed, total_tc , "test case", "failed" ); + print_result( output, tr.p_test_cases_skipped, total_tc , "test case", "skipped" ); + print_result( output, tr.p_test_cases_aborted, total_tc , "test case", "aborted" ); + } output << std::endl; }