diff --git a/include/internal/catch_totals.hpp b/include/internal/catch_totals.hpp index e289a0f0..75386ae8 100644 --- a/include/internal/catch_totals.hpp +++ b/include/internal/catch_totals.hpp @@ -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; diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index f9373598..84904cb0 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -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, '=' );