| 2854 | } |
| 2855 | |
| 2856 | void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test, |
| 2857 | int /*iteration*/) { |
| 2858 | ColoredPrintf(COLOR_GREEN, "[==========] "); |
| 2859 | printf("%s from %s ran.", |
| 2860 | FormatTestCount(unit_test.test_to_run_count()).c_str(), |
| 2861 | FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str()); |
| 2862 | if (GTEST_FLAG(print_time)) { |
| 2863 | printf(" (%s ms total)", |
| 2864 | internal::StreamableToString(unit_test.elapsed_time()).c_str()); |
| 2865 | } |
| 2866 | printf("\n"); |
| 2867 | ColoredPrintf(COLOR_GREEN, "[ PASSED ] "); |
| 2868 | printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str()); |
| 2869 | |
| 2870 | int num_failures = unit_test.failed_test_count(); |
| 2871 | if (!unit_test.Passed()) { |
| 2872 | const int failed_test_count = unit_test.failed_test_count(); |
| 2873 | ColoredPrintf(COLOR_RED, "[ FAILED ] "); |
| 2874 | printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str()); |
| 2875 | PrintFailedTests(unit_test); |
| 2876 | printf("\n%2d FAILED %s\n", num_failures, |
| 2877 | num_failures == 1 ? "TEST" : "TESTS"); |
| 2878 | } |
| 2879 | |
| 2880 | int num_disabled = unit_test.reportable_disabled_test_count(); |
| 2881 | if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) { |
| 2882 | if (!num_failures) { |
| 2883 | printf("\n"); // Add a spacer if no FAILURE banner is displayed. |
| 2884 | } |
| 2885 | ColoredPrintf(COLOR_YELLOW, |
| 2886 | " YOU HAVE %d DISABLED %s\n\n", |
| 2887 | num_disabled, |
| 2888 | num_disabled == 1 ? "TEST" : "TESTS"); |
| 2889 | } |
| 2890 | // Ensure that Google Test output is printed before, e.g., heapchecker output. |
| 2891 | fflush(stdout); |
| 2892 | } |
| 2893 | |
| 2894 | // End PrettyUnitTestResultPrinter |
| 2895 |
no test coverage detected