aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2006-06-02 04:13:57 +0000
committerBen Elliston <bje@gnu.org>2006-06-02 04:13:57 +0000
commit25d1791f2e3efd751309679eab7a115166527a28 (patch)
tree78046bd33953c80f8bfe293ebf8e52279590dc07
parent2749bbd4c82a16969665b184957965ea008417b8 (diff)
downloaddejagnu-25d1791f2e3efd751309679eab7a115166527a28.zip
dejagnu-25d1791f2e3efd751309679eab7a115166527a28.tar.gz
dejagnu-25d1791f2e3efd751309679eab7a115166527a28.tar.bz2
Import this useful script from GCC. It's useful to any DejaGnu user.
* contrib/compare_tests: Import from the GCC contrib directory.
-rw-r--r--ChangeLog4
-rwxr-xr-xcontrib/compare_tests105
2 files changed, 109 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 40e0fde..2c4d748 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-02 Ben Elliston <bje@gnu.org>
+
+ * contrib/compare_tests: Import from the GCC contrib directory.
+
2006-05-24 Ben Elliston <bje@gnu.org>
* runtest.exp (verbose): Brace some expressions.
diff --git a/contrib/compare_tests b/contrib/compare_tests
new file mode 100755
index 0000000..a7fc671
--- /dev/null
+++ b/contrib/compare_tests
@@ -0,0 +1,105 @@
+#!/bin/sh
+# This script automatically test the given tool with the tool's test cases,
+# reporting anything of interest.
+
+# exits with 0 if there is nothing of interest
+# exits with 1 if there is something interesting
+# exits with 2 if an error occurred
+
+# Give two .sum files to compare them
+
+# Written by Mike Stump <mrs@cygnus.com>
+
+tool=gxx
+
+tmp1=/tmp/$tool-testing.$$a
+tmp2=/tmp/$tool-testing.$$b
+now_s=/tmp/$tool-testing.$$d
+before_s=/tmp/$tool-testing.$$e
+
+if [ "$2" = "" ]; then
+ echo "Usage: $0 previous current" >&2
+ exit 2
+fi
+
+sed 's/^XFAIL/FAIL/; s/^XPASS/PASS/' < "$1" >$tmp1
+sed 's/^XFAIL/FAIL/; s/^XPASS/PASS/' < "$2" >$tmp2
+
+before=$tmp1
+now=$tmp2
+
+exit_status=0
+trap "rm -f $tmp1 $tmp2 $now_s $before_s" 0 1 2 3 5 9 13 15
+
+sort -t ':' +1 "$now" > "$now_s"
+sort -t ':' +1 "$before" > "$before_s"
+
+grep '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
+grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -12 $tmp1 - >$tmp2
+
+grep -s . $tmp2 >/dev/null
+if [ $? = 0 ]; then
+ echo "Tests that now fail, but worked before:"
+ echo
+ cat $tmp2
+ echo
+ exit_status=1
+fi
+
+grep '^PASS' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
+grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -12 $tmp1 - >$tmp2
+
+grep -s . $tmp2 >/dev/null
+if [ $? = 0 ]; then
+ echo "Tests that now work, but didn't before:"
+ echo
+ cat $tmp2
+ echo
+fi
+
+grep '^FAIL' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
+grep '^[PF]A[SI][SL]' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -23 $tmp1 - >$tmp2
+
+grep -s . $tmp2 >/dev/null
+if [ $? = 0 ]; then
+ echo "New tests that FAIL:"
+ echo
+ cat $tmp2
+ echo
+ exit_status=1
+fi
+
+grep '^PASS' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
+grep '^[PF]A[SI][SL]' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -23 $tmp1 - >$tmp2
+
+grep -s . $tmp2 >/dev/null
+if [ $? = 0 ]; then
+ echo "New tests that PASS:"
+ echo
+ cat $tmp2
+ echo
+fi
+
+grep '^[PF]A[SI][SL]' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
+grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -13 $tmp1 - >$tmp2
+
+grep -s . $tmp2 >/dev/null
+if [ $? = 0 ]; then
+ echo "Old tests that passed, that have disappeared: (Eeek!)"
+ echo
+ cat $tmp2
+ echo
+fi
+
+grep '^[PF]A[SI][SL]' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
+grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -13 $tmp1 - >$tmp2
+
+grep -s . $tmp2 >/dev/null
+if [ $? = 0 ]; then
+ echo "Old tests that failed, that have disappeared: (Eeek!)"
+ echo
+ cat $tmp2
+ echo
+fi
+
+exit $exit_status