Fix TAP output and summary.
authorStas Kobzar <stas@modulis.ca>
Tue, 4 Apr 2017 15:06:15 +0000 (11:06 -0400)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 5 Apr 2017 06:40:50 +0000 (08:40 +0200)
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
src/cmocka.c
tests/CMakeLists.txt

index a74a8e5..6efb4ec 100644 (file)
@@ -2335,7 +2335,7 @@ static void cmprintf_standard(enum cm_printf_type type,
 
 static void cmprintf_group_start_tap(const size_t num_tests)
 {
-    print_message("\t1..%u\n", (unsigned)num_tests);
+    print_message("1..%u\n", (unsigned)num_tests);
 }
 
 static void cmprintf_group_finish_tap(const char *group_name,
@@ -2347,7 +2347,7 @@ static void cmprintf_group_finish_tap(const char *group_name,
     if (total_passed + total_skipped == total_executed) {
         status = "ok";
     }
-    print_message("%s - %s\n", status, group_name);
+    print_message("%s - %s\n", status, group_name);
 }
 
 static void cmprintf_tap(enum cm_printf_type type,
@@ -2359,10 +2359,10 @@ static void cmprintf_tap(enum cm_printf_type type,
     case PRINTF_TEST_START:
         break;
     case PRINTF_TEST_SUCCESS:
-        print_message("\tok %u - %s\n", (unsigned)test_number, test_name);
+        print_message("ok %u - %s\n", (unsigned)test_number, test_name);
         break;
     case PRINTF_TEST_FAILURE:
-        print_message("\tnot ok %u - %s\n", (unsigned)test_number, test_name);
+        print_message("not ok %u - %s\n", (unsigned)test_number, test_name);
         if (error_message != NULL) {
             char *msg;
             char *p;
@@ -2381,7 +2381,7 @@ static void cmprintf_tap(enum cm_printf_type type,
                     p[0] = '\0';
                 }
 
-                print_message("\t# %s\n", q);
+                print_message("# %s\n", q);
 
                 if (p == NULL) {
                     break;
@@ -2392,10 +2392,10 @@ static void cmprintf_tap(enum cm_printf_type type,
         }
         break;
     case PRINTF_TEST_SKIPPED:
-        print_message("\tnot ok %u # SKIP %s\n", (unsigned)test_number, test_name);
+        print_message("not ok %u # SKIP %s\n", (unsigned)test_number, test_name);
         break;
     case PRINTF_TEST_ERROR:
-        print_message("\tnot ok %u - %s %s\n",
+        print_message("not ok %u - %s %s\n",
                       (unsigned)test_number, test_name, error_message);
         break;
     }
index 68ae4ac..b1380de 100644 (file)
@@ -153,21 +153,21 @@ set(TEST_OUTPUT_FMTS
     xml)
 
 set(test_basics_tap_out
-    "^\t1\\.\\.2"
-    "\tok 1 - null_test_success"
-    "\tok 2 - int_test_success"
-    "ok - tests")
+    "^1\\.\\.2"
+    "ok 1 - null_test_success"
+    "ok 2 - int_test_success"
+    "ok - tests")
 set(test_assert_macros_fail_tap_out
-    "^\t1\\.\\.1"
-    "\tnot ok 1 - test_assert_return_code_fail"
-    "\t#[^\n\r]+[\n\r]\t#[^\n\r]+[\n\r]not ok - tests")
+    "^1\\.\\.1"
+    "not ok 1 - test_assert_return_code_fail"
+    "#[^\n\r]+[\n\r]#[^\n\r]+[\n\r]# not ok - tests")
 set(test_groups_tap_out
-    "^\t1\\.\\.1"
-    "\tok 1 - null_test_success"
-    "ok - test_group1"
-    "\t1\\.\\.1"
-    "\tok 1 - int_test_success"
-    "ok - test_group2")
+    "^1\\.\\.1"
+    "ok 1 - null_test_success"
+    "ok - test_group1"
+    "1\\.\\.1"
+    "ok 1 - int_test_success"
+    "ok - test_group2")
 set(test_skip_tap_out
     "not ok 1 # SKIP")
 set(test_setup_fail_tap_out