Skip to content
This repository
Browse code

test: fix tap output even when ok but have output

  • Loading branch information...
commit 49d2ae33ef4f871496e042ed83cf5a7c65b97857 1 parent 1821bba
Timothy J Fontaine authored bnoordhuis committed

Showing 1 changed file with 9 additions and 4 deletions. Show diff stats Hide diff stats

  1. 13  test/runner.c
13  test/runner.c
@@ -255,10 +255,17 @@ int run_test(const char* test,
255 255
     FATAL("process_wait failed");
256 256
   }
257 257
 
  258
+  if (tap_output) {
  259
+    if (status == 0)
  260
+      LOGF("ok %d - %s\n", test_count, test);
  261
+    else
  262
+      LOGF("not ok %d - %s\n", test_count, test);
  263
+  }
  264
+
258 265
   /* Show error and output from processes if the test failed. */
259 266
   if (status != 0 || task->show_output) {
260  
-    if (tap_output && status != 0) {
261  
-      LOGF("not ok %d - %s\n#", test_count, test);
  267
+    if (tap_output) {
  268
+      LOGF("#");
262 269
     } else if (status != 0) {
263 270
       LOGF("\n`%s` failed: %s\n", test, errmsg);
264 271
     } else {
@@ -305,8 +312,6 @@ int run_test(const char* test,
305 312
       }
306 313
       break;
307 314
     }
308  
-  } else if (tap_output) {
309  
-    LOGF("ok %d - %s\n", test_count, test);
310 315
   }
311 316
 
312 317
   /* Clean up all process handles. */

0 notes on commit 49d2ae3

Please sign in to comment.
Something went wrong with that request. Please try again.