This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
regression/btest-gcc.sh: Support --add-passes-despite-regression
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: geoffk at geoffk dot org
- Date: Mon, 6 Jun 2005 05:32:27 +0200
- Subject: regression/btest-gcc.sh: Support --add-passes-despite-regression
ISTR I've suggested this functionality before but it was turned
down as the default because it could cause spurious PASSes. But
that's not a good enough reason: what statistically happens is
*not* that some regression somehow causes spurious PASSes, but
that a *single* long-standing regression stops
regression-checking of test-cases added later. Not necessarily
good for a script that's supposed to test regressions...
Anyway, I made the suggested behavior optional. Tested with and
without this option in IIRC all combinations (with/without new
fails, passes, with/without state being PASS).
Note that FAILs still aren't removed until "pass"; only new
tests that PASS are merged in. I kept indentation style as per
surrounding code.
I'll also take the opportunity to ping the following patches to
btest-gcc.sh:
<URL:http://gcc.gnu.org/ml/gcc-patches/2005-04/msg00766.html>
Make libstdc++.sum optional
<URL:http://gcc.gnu.org/ml/gcc-patches/2005-04/msg01654.html>
Don't pass --with-newlib when target is "*-linux*".
In case the lack of review is due to a policy of never changing
or adding anything to this file, I guess the best action would
be to make a copy, so useful changes can be made.
Ok to commit?
* btest-gcc.sh: Add support for option
--add-passes-despite-regression.
Index: btest-gcc.sh
===================================================================
RCS file: /cvs/gcc/gcc/contrib/regression/btest-gcc.sh,v
retrieving revision 1.10
diff -p -u -r1.10 btest-gcc.sh
--- btest-gcc.sh 27 Oct 2004 18:19:41 -0000 1.10
+++ btest-gcc.sh 6 Jun 2005 03:02:16 -0000
@@ -1,7 +1,7 @@
#!/bin/sh
# Test GCC.
-# Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,7 +18,20 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# INPUT:
-# btest <target> <source> <prefix> <state> <build>
+# btest <options> <target> <source> <prefix> <state> <build>
+
+add_passes_despite_regression=0
+
+# <options> can be
+# --add-passes-despite-regression:
+# Add new "PASSes" despite there being some regressions.
+
+case "$1" in
+ --add-passes-despite-regression)
+ add_passes_despite_regression=1; shift;;
+ --*) echo "Invalid option: $1"; exit 2;;
+esac
+
# TARGET is the target triplet. It should be the same one as used in
# constructing PREFIX. Or it can be the keyword 'native', indicating
# a target of whatever platform the script is running on.
@@ -172,17 +191,34 @@ for LOG in $TESTLOGS ; do
done | sort | uniq > $FAILED || exit 1
comm -12 $FAILED $PASSES >> $REGRESS || exit 1
NUMREGRESS=`wc -l < $REGRESS | tr -d ' '`
-if [ $NUMREGRESS -ne 0 ] ; then
+if [ $NUMREGRESS -ne 0 ] && [ $add_passes_despite_regression -eq 0 ] ; then
echo regress-$NUMREGRESS > $RESULT
exit 1
fi
-# It passed. Update the state.
+# Update the state.
for LOG in $TESTLOGS ; do
L=`basename $LOG`
awk '/^PASS: / { print "'$L'",$2; }' $LOG || exit 1
done | sort | uniq | comm -23 - $FAILED > ${PASSES}~ || exit 1
[ -s ${PASSES}~ ] || exit 1
-mv ${PASSES}~ ${PASSES} || exit 1
+if [ $NUMREGRESS -ne 0 ] ; then
+ # While in regression, merge in previous PASSes, since there's a
+ # regressive difference we don't want to forget. We don't do this
+ # when PASS (no or non-regressive difference), so we get rid of PASS
+ # lines for removed, moved or otherwise changed tests which may be
+ # added back with a different meaning later on.
+ cat ${PASSES}~ ${PASSES} | sort -u > ${PASSES}~~
+ mv ${PASSES}~~ ${PASSES} || exit 1
+ rm ${PASSES}~ || exit 1
+else
+ mv ${PASSES}~ ${PASSES} || exit 1
+fi
+
+if [ $NUMREGRESS -ne 0 ] ; then
+ echo regress-$NUMREGRESS > $RESULT
+ exit 1
+fi
+
echo pass > $RESULT
exit 0
brgds, H-P