diff options
| author | Phil Nash | 2014-07-09 18:24:24 +0100 |
|---|---|---|
| committer | Phil Nash | 2014-07-09 18:24:24 +0100 |
| commit | cab9141eec0c0f155e1d26e25b900fcaa4827c24 (patch) | |
| tree | 5106daec1c2ded4399fc45a099ccfb7632e566cc /include | |
| parent | d89e74faff158a921336b759cfbb4ceae8450225 (diff) | |
| download | catch3-cab9141eec0c0f155e1d26e25b900fcaa4827c24.tar.gz | |
Green summary bar is darker if not all passed
- and the green part now comes at the end (to emphasise the failures)
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_totals.hpp | 3 | ||||
| -rw-r--r-- | include/reporters/catch_reporter_console.hpp | 5 |
2 files changed, 7 insertions, 1 deletions
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, '=' ); |