| 4564 | } |
| 4565 | |
| 4566 | void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) { |
| 4567 | if (test_info.result()->Passed()) { |
| 4568 | ColoredPrintf(COLOR_GREEN, "[ OK ] "); |
| 4569 | } else { |
| 4570 | ColoredPrintf(COLOR_RED, "[ FAILED ] "); |
| 4571 | } |
| 4572 | PrintTestName(test_info.test_case_name(), test_info.name()); |
| 4573 | if (test_info.result()->Failed()) |
| 4574 | PrintFullTestCommentIfPresent(test_info); |
| 4575 | |
| 4576 | if (GTEST_FLAG(print_time)) { |
| 4577 | printf(" (%s ms)\n", internal::StreamableToString( |
| 4578 | test_info.result()->elapsed_time()).c_str()); |
| 4579 | } else { |
| 4580 | printf("\n"); |
| 4581 | } |
| 4582 | fflush(stdout); |
| 4583 | } |
| 4584 | |
| 4585 | void PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) { |
| 4586 | if (!GTEST_FLAG(print_time)) return; |
no test coverage detected