From: Pawel Szewczyk Date: Mon, 11 May 2015 11:34:29 +0000 (+0200) Subject: cmocka: Print skipped tests in group summary X-Git-Tag: cmocka-1.1.1~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8939ed38aa1c8e1e7eafb34dd7fa8d3ed569476d;p=platform%2Fupstream%2Fcmocka.git cmocka: Print skipped tests in group summary When running tests with standard output, information about skipped tests can be useful, especially when there are many tests. This commit add number of skipped tests and list of them to group summary. Signed-off-by: Pawel Szewczyk Reviewed-by: Andreas Schneider --- diff --git a/src/cmocka.c b/src/cmocka.c index 40be60a..fc83b57 100644 --- a/src/cmocka.c +++ b/src/cmocka.c @@ -1986,6 +1986,7 @@ static void cmprintf_group_finish_standard(size_t total_executed, size_t total_passed, size_t total_failed, size_t total_errors, + size_t total_skipped, struct CMUnitTestState *cm_tests) { size_t i; @@ -1994,6 +1995,18 @@ static void cmprintf_group_finish_standard(size_t total_executed, print_error("[ PASSED ] %u test(s).\n", (unsigned)(total_passed)); + if (total_skipped) { + print_error("[ SKIPPED ] %"PRIdS " test(s), listed below:\n", total_skipped); + for (i = 0; i < total_executed; i++) { + struct CMUnitTestState *cmtest = &cm_tests[i]; + + if (cmtest->status == CM_TEST_SKIPPED) { + print_error("[ SKIPPED ] %s\n", cmtest->test->name); + } + } + print_error("\n %u SKIPPED TEST(S)\n", (unsigned)(total_skipped)); + } + if (total_failed) { print_error("[ FAILED ] %"PRIdS " test(s), listed below:\n", total_failed); for (i = 0; i < total_executed; i++) { @@ -2170,6 +2183,7 @@ static void cmprintf_group_finish(const char *group_name, total_passed, total_failed, total_errors, + total_skipped, cm_tests); break; case CM_OUTPUT_SUBUNIT: