Skip to content

Commit

Permalink
test: Signal an error if trigger does not exist
Browse files Browse the repository at this point in the history
The behavior had been to ignore the trigger silently, leading to
mystifying outcomes.

Clean up a few other minor issues in runtest.sh.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
euloh authored and kvanhees committed Oct 25, 2022
1 parent d6af0ed commit 827e4e2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,11 @@ for dt in $dtrace; do
if [[ "x$trigger" = "xnone" ]] || [[ -z $trigger ]]; then
:
elif [[ ! -x test/triggers/$(printf '%s' "$trigger" | cut -d\ -f1) ]]; then
trigger=
out "$_test: "
fail=t
trigger=$(printf '%s' "$trigger" | cut -d\ -f1)
fail "$xfail" "$xfailmsg" "trigger $trigger not found in test/triggers"
continue
else
trigger="test/triggers/$trigger"
fi
Expand Down Expand Up @@ -1134,7 +1138,7 @@ for dt in $dtrace; do
run="$vg $tmpdir/$(basename $base)"
fi
# No trigger. Erase any pre-existing coredump, then un dtrace, with a
# Erase any pre-existing coredump, then run dtrace, with a
# timeout, without permitting execution, recording the output and
# exitcode into temporary files. (We use a different temporary file on
# every invocation, so that hanging subprocesses emitting output into
Expand Down Expand Up @@ -1166,7 +1170,6 @@ for dt in $dtrace; do
log "Compiling $CCline\n"
if ! $CCline >/dev/null 2>$tmpdir/cc.err; then
fail=t
failmsg="compilation failure"
fail "$xfail" "$xfailmsg" "compilation failure"
cat $tmpdir/cc.err >> $LOGFILE
continue
Expand All @@ -1179,6 +1182,7 @@ for dt in $dtrace; do
tst=$base
export tst
if [[ -z $trigger ]] || [[ "$trigger" = "none" ]]; then
# No trigger.
case $progtype in
d) eflag=
if [[ -z $trigger ]]; then
Expand Down

0 comments on commit 827e4e2

Please sign in to comment.