Esempio n. 1
0
// Internal helper for printing the list of failed tests at end of run.
void TersePrinter::PrintFailedTestsList(const UnitTest& unit_test) const
{
	const int failed_test_count = unit_test.failed_test_count();
	if (failed_test_count == 0)
		return;
	for (int i = 0; i < unit_test.total_test_case_count(); ++i)
	{
		const TestCase& test_case = *unit_test.GetTestCase(i);
		if (!test_case.should_run() || (test_case.failed_test_count() == 0))
			continue;
		for (int j = 0; j < test_case.total_test_count(); ++j)
		{
			const TestInfo& test_info = *test_case.GetTestInfo(j);
			if (!test_info.should_run() || test_info.result()->Passed())
				continue;
			ColoredPrintf(COLOR_RED, "%s", "[  FAILED  ] ");
			printf("%s.%s\n", test_case.name(), test_info.name());
		}
	}
}
// Internal helper for printing the list of failed tests.
void SDKUnitTestListener::PrintFailedTests(const UnitTest& unit_test) {
	const int failed_test_count = unit_test.failed_test_count();
	if (failed_test_count == 0) {
		return;
	}

	for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
		const TestCase& test_case = *unit_test.GetTestCase(i);
		if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {
			continue;
		}
		for (int j = 0; j < test_case.total_test_count(); ++j) {
			const TestInfo& test_info = *test_case.GetTestInfo(j);
			if (!test_info.should_run() || test_info.result()->Passed()) {
				continue;
			}
			Msg( "[  FAILED  ] ");
			Msg("%s.%s", test_case.name(), test_info.name());
			Msg("\n");
		}
	}
}