diff options
Diffstat (limited to 'lib/test-driver')
-rwxr-xr-x | lib/test-driver | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/test-driver b/lib/test-driver index c1645a22d..89f6914f3 100755 --- a/lib/test-driver +++ b/lib/test-driver @@ -31,12 +31,6 @@ scriptversion=2011-08-04.22; # UTC # helps a lot in preventing typo-related bugs. set -u -fatal () -{ - echo "$0: fatal: $*" >&2 - exit 1 -} - usage_error () { echo "$0: $*" >&2 @@ -56,10 +50,10 @@ END } # TODO: better error handling in option parsing (in particular, ensure -# TODO: $logfile, $trsfile and $test_name are defined). +# TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. -logfile= # Where to save the output of the test script. -trsfile= # Where to save the result(s) the test script. +log_file= # Where to save the output of the test script. +trs_file= # Where to save the metadata of the test run. expect_failure=no color_tests=no enable_hard_errors=yes @@ -68,8 +62,8 @@ while test $# -gt 0; do --help) print_usage; exit $?;; --version) echo "test-driver $scriptversion"; exit $?;; --test-name) test_name=$2; shift;; - --log-file) logfile=$2; shift;; - --trs-file) trsfile=$2; shift;; + --log-file) log_file=$2; shift;; + --trs-file) trs_file=$2; shift;; --color-tests) color_tests=$2; shift;; --expect-failure) expect_failure=$2; shift;; --enable-hard-errors) enable_hard_errors=$2; shift;; @@ -90,14 +84,14 @@ else red= grn= lgn= blu= mgn= std= fi -do_exit='rm -f $logfile; (exit $st); exit $st' +do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' trap "st=129; $do_exit" 1 trap "st=130; $do_exit" 2 trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 # Test script is run here. -"$@" >$logfile 2>&1 +"$@" >$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 @@ -116,10 +110,10 @@ esac echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. -echo ":test-result: $res" > $trsfile -echo ":global-test-result: $res" >> $trsfile -echo ":recheck: $recheck" >> $trsfile -echo ":copy-in-global-log: $gcopy" >> $trsfile +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script |