Internal helper for printing the list of failed tests.
| 4131 | |
| 4132 | // Internal helper for printing the list of failed tests. |
| 4133 | void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) { |
| 4134 | const int failed_test_count = unit_test.failed_test_count(); |
| 4135 | if (failed_test_count == 0) { |
| 4136 | return; |
| 4137 | } |
| 4138 | |
| 4139 | for (int i = 0; i < unit_test.total_test_case_count(); ++i) { |
| 4140 | const TestCase& test_case = *unit_test.GetTestCase(i); |
| 4141 | if (!test_case.should_run() || (test_case.failed_test_count() == 0)) { |
| 4142 | continue; |
| 4143 | } |
| 4144 | for (int j = 0; j < test_case.total_test_count(); ++j) { |
| 4145 | const TestInfo& test_info = *test_case.GetTestInfo(j); |
| 4146 | if (!test_info.should_run() || test_info.result()->Passed()) { |
| 4147 | continue; |
| 4148 | } |
| 4149 | ColoredPrintf(COLOR_RED, "[ FAILED ] "); |
| 4150 | printf("%s.%s", test_case.name(), test_info.name()); |
| 4151 | PrintFullTestCommentIfPresent(test_info); |
| 4152 | printf("\n"); |
| 4153 | } |
| 4154 | } |
| 4155 | } |
| 4156 | |
| 4157 | void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test, |
| 4158 | int /*iteration*/) { |
nothing calls this directly
no test coverage detected