summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2020-06-09 21:23:57 +0200
committerAndreas Schneider <asn@cryptomilk.org>2020-10-04 09:36:47 +0200
commitf49d5c476ab18c14c5e905ffc0e83b77bde6541c (patch)
tree67091b625b51f0834758187d632dc9bd864a68d0
parentf615c3f3e78b9fd60f4803b823b49e55420a36ce (diff)
downloadcmocka-f49d5c476ab18c14c5e905ffc0e83b77bde6541c.zip
cmocka-f49d5c476ab18c14c5e905ffc0e83b77bde6541c.tar.gz
cmocka-f49d5c476ab18c14c5e905ffc0e83b77bde6541c.tar.bz2
Fix TAP output for skipped tests
According to [1], a skipped test should print "ok" and not "not ok" before "# SKIP". This breaks tests harnesses like the one built into Meson [2]. [1] http://testanything.org/tap-specification.html [2] https://mesonbuild.com/Unit-tests.html
-rw-r--r--src/cmocka.c2
-rw-r--r--tests/CMakeLists.txt2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cmocka.c b/src/cmocka.c
index 4b88026..5863a27 100644
--- a/src/cmocka.c
+++ b/src/cmocka.c
@@ -2672,7 +2672,7 @@ static void cmprintf_tap(enum cm_printf_type type,
}
break;
case PRINTF_TEST_SKIPPED:
- print_message("not ok %u # SKIP %s\n", (unsigned)test_number, test_name);
+ print_message("ok %u # SKIP %s\n", (unsigned)test_number, test_name);
break;
case PRINTF_TEST_ERROR:
print_message("not ok %u - %s %s\n",
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index e016d6a..60e727a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -190,7 +190,7 @@ set(test_groups_tap_out
"ok 1 - int_test_success"
"# ok - test_group2")
set(test_skip_tap_out
- "not ok 1 # SKIP")
+ "ok 1 # SKIP")
set(test_setup_fail_tap_out
"not ok 1 - int_test_ignored Could not run test: Test setup failed")