Green summary bar is darker if not all passed

- and the green part now comes at the end (to emphasise the failures)
This commit is contained in:
Phil Nash 2014-07-09 18:24:24 +01:00
parent d89e74faff
commit cab9141eec
2 changed files with 7 additions and 1 deletions

View File

@ -32,6 +32,9 @@ namespace Catch {
std::size_t total() const {
return passed + failed + failedButOk;
}
bool allPassed() const {
return failed == 0 && failedButOk == 0;
}
std::size_t passed;
std::size_t failed;

View File

@ -388,9 +388,12 @@ namespace Catch {
while( failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH-1 )
findMax( failedRatio, failedButOkRatio, passedRatio )--;
stream << Colour( Colour::ResultSuccess ) << std::string( passedRatio, '=' );
stream << Colour( Colour::Error ) << std::string( failedRatio, '=' );
stream << Colour( Colour::ResultExpectedFailure ) << std::string( failedButOkRatio, '=' );
if( totals.testCases.allPassed() )
stream << Colour( Colour::ResultSuccess ) << std::string( passedRatio, '=' );
else
stream << Colour( Colour::Success ) << std::string( passedRatio, '=' );
}
else {
stream << Colour( Colour::Warning ) << std::string( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' );