sessiond: clarify the role of notification credentials
[lttng-tools.git] / config / tap-driver.sh
index ee61fc1129630cd9deefbf3b448d69255a5a352c..65037ab65f5dfb03d729704d0132217b66091053 100755 (executable)
@@ -52,7 +52,7 @@ Usage:
                 [--expect-failure={yes|no}] [--color-tests={yes|no}]
                 [--enable-hard-errors={yes|no}] [--ignore-exit]
                 [--diagnostic-string=STRING] [--merge|--no-merge]
-                [--comments|--no-comments] [--] TEST-COMMAND
+                [--comments|--no-comments] [--post-script] [--] TEST-COMMAND
 The '--test-name', '-log-file' and '--trs-file' options are mandatory.
 END
 }
@@ -62,6 +62,7 @@ END
 test_name= # Used for reporting.
 log_file=  # Where to save the result and output of the test script.
 trs_file=  # Where to save the metadata of the test run.
+post_script= # Script to be run after the test.
 expect_failure=0
 color_tests=0
 merge=0
@@ -84,6 +85,7 @@ while test $# -gt 0; do
   --comments) comments=1;;
   --no-comments) comments=0;;
   --diagnostic-string) diag_string=$2; shift;;
+  --post-script) post_script=$2; shift;;
   --) shift; break;;
   -*) usage_error "invalid option: '$1'";;
   esac
@@ -273,6 +275,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";
@@ -640,6 +645,11 @@ exit 0
 
 test $? -eq 0 || fatal "I/O or internal error"
 
+if test ! -z $post_script ; then
+  $post_script
+  test $? -eq 0 || fatal "Post script returned an error. See $log_file"
+fi
+
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
This page took 0.024341 seconds and 5 git commands to generate.