]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
contrib/regression/btest-gcc.sh: Optionally handle XPASS.
authorHans-Peter Nilsson <hp@axis.com>
Wed, 22 Nov 2023 17:52:34 +0000 (18:52 +0100)
committerHans-Peter Nilsson <hp@bitrange.com>
Thu, 23 Nov 2023 23:21:31 +0000 (00:21 +0100)
Tests with keys that match both PASS, FAIL (or now
optionally XPASS), count as fail.  XPASSes were previously
ignored.  Handling them as FAIL seems the most useful
alternative, but not counting XPASSes may be deliberate.
It's also a matter of compatibility, so make it optional.

Attempts to use --handle-xpass-as-fail was previously
flagged as a usage error.  If you pass it now, on state with
previous mixed XPASS and PASS results but doesn't change in
this run, the XPASS is discovered as a (new) regression.
For new XPASSing tests, it's handled as a new FAIL.

* btest-gcc.sh (--handle-xpass-as-fail): New option.

contrib/regression/btest-gcc.sh

index 3c031e93709bdcacf435b475e76d54d7f89920d7..684019f715f1bb6dc2c15ec91b77009f40bed100 100755 (executable)
 
 add_passes_despite_regression=0
 dashj=''
+handle_xpass_as_fail=false
 
 # <options> can be
 # --add-passes-despite-regression:
 #  Add new "PASSes" despite there being some regressions.
 # -j<n>:
 #  Pass '-j<n>' to make.
+# --handle-xpass-as-fail:
+#  Count XPASS as a FAIL (default ignored).
 
 while : ; do
   case "$1" in
    --add-passes-despite-regression)
     add_passes_despite_regression=1;;
+   --handle-xpass-as-fail)
+    handle_xpass_as_fail=true;;
    -j*)
     dashj=$1;;
    -*) echo "Invalid option: $1"; exit 2;;
@@ -203,7 +208,11 @@ done
 # Work out what failed
 for LOG in $TESTLOGS ; do
   L=`basename $LOG`
-  awk '/^FAIL: / { print "'$L'",$2; }' $LOG || exit 1
+  if $handle_xpass_as_fail ; then
+   awk '/^(FAIL|XPASS): / { print "'$L'",$2; }' $LOG || exit 1
+  else
+   awk '/^FAIL: / { print "'$L'",$2; }' $LOG || exit 1
+  fi
 done | sort | uniq > $FAILED || exit 1
 comm -12 $FAILED $PASSES >> $REGRESS || exit 1
 NUMREGRESS=`wc -l < $REGRESS | tr -d ' '`