| 12149 | } |
| 12150 | |
| 12151 | void ConsoleReporter::printTotalsDivider(Totals const& totals) { |
| 12152 | if (totals.testCases.total() > 0) { |
| 12153 | std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total()); |
| 12154 | std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total()); |
| 12155 | std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total()); |
| 12156 | while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1) |
| 12157 | findMax(failedRatio, failedButOkRatio, passedRatio)++; |
| 12158 | while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1) |
| 12159 | findMax(failedRatio, failedButOkRatio, passedRatio)--; |
| 12160 | |
| 12161 | stream << Colour(Colour::Error) << std::string(failedRatio, '='); |
| 12162 | stream << Colour(Colour::ResultExpectedFailure) << std::string(failedButOkRatio, '='); |
| 12163 | if (totals.testCases.allPassed()) |
| 12164 | stream << Colour(Colour::ResultSuccess) << std::string(passedRatio, '='); |
| 12165 | else |
| 12166 | stream << Colour(Colour::Success) << std::string(passedRatio, '='); |
| 12167 | } else { |
| 12168 | stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '='); |
| 12169 | } |
| 12170 | stream << '\n'; |
| 12171 | } |
| 12172 | void ConsoleReporter::printSummaryDivider() { |
| 12173 | stream << getLineOfChars<'-'>() << '\n'; |
| 12174 | } |