_STRING
text_test_interpreter::errors(const test_result& result) const
{
    _STRING Result("Errors: ");
    _APPEND(Result, _yak_itoa(result.errors().size()));
    _APPEND(Result, "\n");
    _APPEND(Result, problem_vector_string(result.errors()));
    _APPEND(Result, "\n");
    return Result;
}
Exemple #2
0
void test::test::run_test(test_result& results) {
    try {
        results.start(_name);
        (*this)();
        results.success(_name);
    }
    catch (const test_failure& tf) {
        results.failure(_name, tf.what());
    }
    catch (const std::exception& se) {
        results.error(_name, se.what());
    }
    catch (...) {
        results.error(_name, "Unknown exception");
    }
}
_STRING
text_test_interpreter::footer(const test_result& result) const
{
    result.total_test_count();
    _STRING Result("Test output ends\n");
    return Result;
}
_STRING
text_test_interpreter::successes(const test_result& result) const
{
    _STRING Result("Successes: ");
    _APPEND(Result, _yak_itoa(result.success_count()));
    _APPEND(Result, "\n");
    return Result;
}
//the header for the report
_STRING
text_test_interpreter::header(const test_result& result) const
{
    _STRING Result("\nTest output begins\nNumber of tests: ");
    _APPEND(Result, _yak_itoa(result.total_test_count()));
    _APPEND(Result, "\n");
    return Result;

}
 LIBUPTESTAPI
 void console_test_listener::stopped(test_suite const&, test_result const& result) {
     if (result.failed()) {
         printf("\n%s\n\n%s", section_separator, error_buffer_);
     }
         
     printf("\n%s\n", section_separator);
     printf("        Total Tests: %5d\n", result.test_count());
     printf("    Total Tests Run: %5d\n", result.tests_run());
     printf("Total Ignored Tests: %5d\n", result.tests_ignored());
     printf(" Total Failed Tests: %5d\n", result.tests_failed());
     printf(" Total Passed Tests: %5d\n", result.tests_passed());
 }
Exemple #7
0
 void meta_require(const location& location_)
 {
   const test_result result = test_result::build<Pred>(location_);
   BOOST_REQUIRE_MESSAGE(result.success(), result);
 }
Exemple #8
0
 void meta_check(const location& location_)
 {
   const test_result result = test_result::build<Pred>(location_);
   BOOST_CHECK_MESSAGE(result.success(), result);
 }
Exemple #9
0
 void meta_warn(const location& location_)
 {
   const test_result result = test_result::build<Pred>(location_);
   BOOST_WARN_MESSAGE(result.success(), result);
 }