diff mbox series

[babeltrace] tap-driver.sh: flush stdout aftereach test result

Message ID 20190313215055.12687-1-mjeanson@efficios.com
State Accepted, archived
Delegated to: Jérémie Galarneau
Headers show
Series [babeltrace] tap-driver.sh: flush stdout aftereach test result | expand

Commit Message

Michael Jeanson March 13, 2019, 9:50 p.m. UTC
This is useful in a CI system where stdout is fully buffered and you
look at the console output to see which test is hanging.

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 config/tap-driver.sh | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/config/tap-driver.sh b/config/tap-driver.sh
index 4254e2b3..12742cae 100755
--- a/config/tap-driver.sh
+++ b/config/tap-driver.sh
@@ -273,6 +273,9 @@  function report(result, details)
     msg = msg " " details
   # Output on console might be colorized.
   print decorate_result(result) msg
+  # Flush stdout after each test result, this is useful when stdout
+  # is buffered, for example in a CI system.
+  fflush()
   # Log the result in the log file too, to help debugging (this is
   # especially true when said result is a TAP error or "Bail out!").
   print result msg | "cat >&3";