diff --git a/Testing/TableTest.h b/Testing/TableTest.h index 8e483a4..942deaa 100644 --- a/Testing/TableTest.h +++ b/Testing/TableTest.h @@ -383,10 +383,10 @@ namespace Alepha::Hydrogen::Testing ::detail:: table_test const auto result= checker( invoker ); if( not result ) { - std::cout << " " << C::testFail << "FAILED CASE" << resetStyle << ": " << comment << std::endl; + std::cout << " " << C::testFail << "FAILED CASE" << resetStyle << ": " << comment << std::endl; ++failureCount; } - else std::cout << " " << C::testPass << "PASSED CASE" << resetStyle << ": " << comment << std::endl; + else std::cout << " " << C::testPass << "PASSED CASE" << resetStyle << ": " << comment << std::endl; } return failureCount; diff --git a/Testing/colors.h b/Testing/colors.h index b84deb8..804188c 100644 --- a/Testing/colors.h +++ b/Testing/colors.h @@ -12,7 +12,8 @@ namespace Alepha::Hydrogen::Testing ::detail:: testing_colors { inline const auto testFail= createStyle( "test-failure", setFgColor( BasicTextColor::red ) ); inline const auto testPass= createStyle( "test-success", setFgColor( BasicTextColor::green ) ); - inline const auto testInfo= createStyle( "test-info", "italic ansi:5"_sgr ); + inline const auto testWarn= createStyle( "test-warn", "italic ansi:5"_sgr ); + inline const auto testInfo= createStyle( "test-info", "ext:rgb235"_sgr ); } } } diff --git a/Testing/test.h b/Testing/test.h index 19f26dc..bcae02c 100644 --- a/Testing/test.h +++ b/Testing/test.h @@ -192,29 +192,33 @@ namespace Alepha::Hydrogen::Testing }; for( const auto &[ name, disabled, test ]: registry() ) - try { if( C::debugTestRun ) std::cerr << "Trying test " << name << std::endl; if( explicitlyNamed( name ) or not disabled and selected( name ) ) { - std::cout << C::testPass << "BEGIN " << resetStyle << ": " << name << std::endl; - test(); - std::cout << C::testPass << "SUCCESS" << resetStyle << ": " << name << std::endl; + std::cout << C::testInfo << "BEGIN" << resetStyle << " : " << name << std::endl; + try + { + test(); + std::cout << " " << C::testPass << "SUCCESS" << resetStyle << ": " << name << std::endl; + } + catch( ... ) + { + try + { + failed= true; + std::cout << " " << C::testFail << "FAILURE" << resetStyle << ": " << name; + throw; + } + catch( const TestFailureException &fail ) { std::cout << " -- " << fail.failureCount << " failures."; } + catch( ... ) { std::cout << " -- unknown failure count"; } + std::cout << std::endl; + } + + std::cout << C::testInfo << "FINISHED" << resetStyle << ": " << name << std::endl; } } - catch( ... ) - { - try - { - failed= true; - std::cout << C::testFail << "FAILURE" << resetStyle << ": " << name; - throw; - } - catch( const TestFailureException &fail ) { std::cout << " -- " << fail.failureCount << " failures."; } - catch( ... ) { std::cout << " -- unknown failure count"; } - std::cout << std::endl; - } return failed ? EXIT_FAILURE : EXIT_SUCCESS; }