[DTrace-devel] [PATCH v2 19/20] test: Signal an error if trigger does not exist

Nick Alcock nick.alcock at oracle.com
Wed Sep 7 13:00:06 UTC 2022


From: Eugene Loh <eugene.loh at oracle.com>

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 at oracle.com>
---
 runtest.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/runtest.sh b/runtest.sh
index e773bc2d43a6..66bca13e20a3 100755
--- a/runtest.sh
+++ b/runtest.sh
@@ -1068,7 +1068,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
@@ -1128,7 +1132,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
@@ -1160,7 +1164,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
@@ -1173,6 +1176,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
-- 
2.37.1.265.g363c192786.dirty




More information about the DTrace-devel mailing list