| 4155 | } |
| 4156 | |
| 4157 | void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test, |
| 4158 | int /*iteration*/) { |
| 4159 | ColoredPrintf(COLOR_GREEN, "[==========] "); |
| 4160 | printf("%s from %s ran.", |
| 4161 | FormatTestCount(unit_test.test_to_run_count()).c_str(), |
| 4162 | FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str()); |
| 4163 | if (GTEST_FLAG(print_time)) { |
| 4164 | printf(" (%s ms total)", |
| 4165 | internal::StreamableToString(unit_test.elapsed_time()).c_str()); |
| 4166 | } |
| 4167 | printf("\n"); |
| 4168 | ColoredPrintf(COLOR_GREEN, "[ PASSED ] "); |
| 4169 | printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str()); |
| 4170 | |
| 4171 | int num_failures = unit_test.failed_test_count(); |
| 4172 | if (!unit_test.Passed()) { |
| 4173 | const int failed_test_count = unit_test.failed_test_count(); |
| 4174 | ColoredPrintf(COLOR_RED, "[ FAILED ] "); |
| 4175 | printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str()); |
| 4176 | PrintFailedTests(unit_test); |
| 4177 | printf("\n%2d FAILED %s\n", num_failures, |
| 4178 | num_failures == 1 ? "TEST" : "TESTS"); |
| 4179 | } |
| 4180 | |
| 4181 | int num_disabled = unit_test.disabled_test_count(); |
| 4182 | if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) { |
| 4183 | if (!num_failures) { |
| 4184 | printf("\n"); // Add a spacer if no FAILURE banner is displayed. |
| 4185 | } |
| 4186 | ColoredPrintf(COLOR_YELLOW, |
| 4187 | " YOU HAVE %d DISABLED %s\n\n", |
| 4188 | num_disabled, |
| 4189 | num_disabled == 1 ? "TEST" : "TESTS"); |
| 4190 | } |
| 4191 | // Ensure that Google Test output is printed before, e.g., heapchecker output. |
| 4192 | fflush(stdout); |
| 4193 | } |
| 4194 | |
| 4195 | // End PrettyUnitTestResultPrinter |
| 4196 |
no test coverage detected