Internal helper for printing the list of failed tests.
| 4603 | |
| 4604 | // Internal helper for printing the list of failed tests. |
| 4605 | void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) { |
| 4606 | const int failed_test_count = unit_test.failed_test_count(); |
| 4607 | if (failed_test_count == 0) { |
| 4608 | return; |
| 4609 | } |
| 4610 | |
| 4611 | for (int i = 0; i < unit_test.total_test_case_count(); ++i) { |
| 4612 | const TestCase& test_case = *unit_test.GetTestCase(i); |
| 4613 | if (!test_case.should_run() || (test_case.failed_test_count() == 0)) { |
| 4614 | continue; |
| 4615 | } |
| 4616 | for (int j = 0; j < test_case.total_test_count(); ++j) { |
| 4617 | const TestInfo& test_info = *test_case.GetTestInfo(j); |
| 4618 | if (!test_info.should_run() || test_info.result()->Passed()) { |
| 4619 | continue; |
| 4620 | } |
| 4621 | ColoredPrintf(COLOR_RED, "[ FAILED ] "); |
| 4622 | printf("%s.%s", test_case.name(), test_info.name()); |
| 4623 | PrintFullTestCommentIfPresent(test_info); |
| 4624 | printf("\n"); |
| 4625 | } |
| 4626 | } |
| 4627 | } |
| 4628 | |
| 4629 | void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test, |
| 4630 | int /*iteration*/) { |
nothing calls this directly
no test coverage detected