summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Szewczyk <p.szewczyk@samsung.com>2015-05-11 11:34:29 (GMT)
committerAndreas Schneider <asn@cryptomilk.org>2015-05-11 11:34:29 (GMT)
commit8939ed38aa1c8e1e7eafb34dd7fa8d3ed569476d (patch)
treee0291f4e370bb8f1fb169c6b87d2a71ee724ddcf
parent3262ba0e224c693463a837f5c2750086d6ef38ee (diff)
downloadcmocka-8939ed38aa1c8e1e7eafb34dd7fa8d3ed569476d.zip
cmocka-8939ed38aa1c8e1e7eafb34dd7fa8d3ed569476d.tar.gz
cmocka-8939ed38aa1c8e1e7eafb34dd7fa8d3ed569476d.tar.bz2
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 <p.szewczyk@samsung.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/cmocka.c14
1 files changed, 14 insertions, 0 deletions
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: