| 13667 | } |
| 13668 | |
| 13669 | void ConsoleReporter::printTotalsDivider(Totals const& totals) { |
| 13670 | if (totals.testCases.total() > 0) { |
| 13671 | std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total()); |
| 13672 | std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total()); |
| 13673 | std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total()); |
| 13674 | while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1) |
| 13675 | findMax(failedRatio, failedButOkRatio, passedRatio)++; |
| 13676 | while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1) |
| 13677 | findMax(failedRatio, failedButOkRatio, passedRatio)--; |
| 13678 | |
| 13679 | stream << Colour(Colour::Error) << std::string(failedRatio, '='); |
| 13680 | stream << Colour(Colour::ResultExpectedFailure) << std::string(failedButOkRatio, '='); |
| 13681 | if (totals.testCases.allPassed()) |
| 13682 | stream << Colour(Colour::ResultSuccess) << std::string(passedRatio, '='); |
| 13683 | else |
| 13684 | stream << Colour(Colour::Success) << std::string(passedRatio, '='); |
| 13685 | } else { |
| 13686 | stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '='); |
| 13687 | } |
| 13688 | stream << '\n'; |
| 13689 | } |
| 13690 | void ConsoleReporter::printSummaryDivider() { |
| 13691 | stream << getLineOfChars<'-'>() << '\n'; |
| 13692 | } |