Internal helper for printing the list of failed tests.
| 4739 | |
| 4740 | // Internal helper for printing the list of failed tests. |
| 4741 | void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) { |
| 4742 | const int failed_test_count = unit_test.failed_test_count(); |
| 4743 | if (failed_test_count == 0) { |
| 4744 | return; |
| 4745 | } |
| 4746 | |
| 4747 | for (int i = 0; i < unit_test.total_test_suite_count(); ++i) { |
| 4748 | const TestSuite& test_suite = *unit_test.GetTestSuite(i); |
| 4749 | if (!test_suite.should_run() || (test_suite.failed_test_count() == 0)) { |
| 4750 | continue; |
| 4751 | } |
| 4752 | for (int j = 0; j < test_suite.total_test_count(); ++j) { |
| 4753 | const TestInfo& test_info = *test_suite.GetTestInfo(j); |
| 4754 | if (!test_info.should_run() || !test_info.result()->Failed()) { |
| 4755 | continue; |
| 4756 | } |
| 4757 | ColoredPrintf(COLOR_RED, "[ FAILED ] "); |
| 4758 | printf("%s.%s", test_suite.name(), test_info.name()); |
| 4759 | PrintFullTestCommentIfPresent(test_info); |
| 4760 | printf("\n"); |
| 4761 | } |
| 4762 | } |
| 4763 | } |
| 4764 | |
| 4765 | // Internal helper for printing the list of skipped tests. |
| 4766 | void PrettyUnitTestResultPrinter::PrintSkippedTests(const UnitTest& unit_test) { |
nothing calls this directly
no test coverage detected