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

Method printTotalsDivider

extlibs/catch/include/catch/catch.hpp:15913–15933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15911}
15912
15913void 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}
15934void ConsoleReporter::printSummaryDivider() {
15935 stream << getLineOfChars<'-'>() << '\n';
15936}

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected