MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / printTotalsDivider

Method printTotalsDivider

unittests/catch.hpp:12151–12171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12149}
12150
12151void 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}
12172void ConsoleReporter::printSummaryDivider() {
12173 stream << getLineOfChars<'-'>() << '\n';
12174}

Callers

nothing calls this directly

Calls 5

makeRatioFunction · 0.85
ColourClass · 0.85
stringClass · 0.85
totalMethod · 0.80
allPassedMethod · 0.80

Tested by

no test coverage detected