| 15911 | } |
| 15912 | |
| 15913 | void ConsoleReporter::printTotalsDivider(Totals const& totals) { |
| 15914 | if (totals.testCases.total() > 0) { |
| 15915 | std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total()); |
| 15916 | std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total()); |
| 15917 | std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total()); |
| 15918 | while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1) |
| 15919 | findMax(failedRatio, failedButOkRatio, passedRatio)++; |
| 15920 | while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1) |
| 15921 | findMax(failedRatio, failedButOkRatio, passedRatio)--; |
| 15922 | |
| 15923 | stream << Colour(Colour::Error) << std::string(failedRatio, '='); |
| 15924 | stream << Colour(Colour::ResultExpectedFailure) << std::string(failedButOkRatio, '='); |
| 15925 | if (totals.testCases.allPassed()) |
| 15926 | stream << Colour(Colour::ResultSuccess) << std::string(passedRatio, '='); |
| 15927 | else |
| 15928 | stream << Colour(Colour::Success) << std::string(passedRatio, '='); |
| 15929 | } else { |
| 15930 | stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '='); |
| 15931 | } |
| 15932 | stream << '\n'; |
| 15933 | } |
| 15934 | void ConsoleReporter::printSummaryDivider() { |
| 15935 | stream << getLineOfChars<'-'>() << '\n'; |
| 15936 | } |