Add --post-script to tap-driver.sh
[lttng-tools.git] / config / tap-driver.sh
index ee61fc1129630cd9deefbf3b448d69255a5a352c..32521614de9dd265fe3002d3aa462e62247499f9 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
@@ -640,6 +642,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.022977 seconds and 4 git commands to generate.