summaryrefslogtreecommitdiff
path: root/contrib/compare_tests
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /contrib/compare_tests
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'contrib/compare_tests')
-rwxr-xr-xcontrib/compare_tests111
1 files changed, 111 insertions, 0 deletions
diff --git a/contrib/compare_tests b/contrib/compare_tests
new file mode 100755
index 000000000..bed97429d
--- /dev/null
+++ b/contrib/compare_tests
@@ -0,0 +1,111 @@
+#!/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" | awk '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' >$tmp1
+sed 's/^XFAIL/FAIL/; s/^XPASS/PASS/' < "$2" | awk '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' >$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
+
+if sort -k 2 </dev/null >/dev/null 2>&1; then
+ skip1='-k 2'
+else
+ skip1='+1'
+fi
+
+sort -t ':' $skip1 "$now" > "$now_s"
+sort -t ':' $skip1 "$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