aboutsummaryrefslogtreecommitdiff
path: root/contrib/compare_tests
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2003-04-04 22:49:10 +0000
committerMike Stump <mrs@apple.com>2003-04-04 22:49:10 +0000
commit89f54d3f76c8be7da1dbb9c36c55a87bfe5f2cf4 (patch)
treeff2425732c2b2dcc11afc330e39d461b8bee7bef /contrib/compare_tests
parentd8d53fb3c4237f43d33fef7628c8fb9d8eebc771 (diff)
* compare_tests: Fix exit status and be more flexible with spacing.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@65255 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib/compare_tests')
-rwxr-xr-xcontrib/compare_tests39
1 files changed, 23 insertions, 16 deletions
diff --git a/contrib/compare_tests b/contrib/compare_tests
index 7a1d76cb827..a7fc6711efb 100755
--- a/contrib/compare_tests
+++ b/contrib/compare_tests
@@ -2,14 +2,16 @@
# This script automatically test the given tool with the tool's test cases,
# reporting anything of interest.
-# exits with 1 if there is nothing of interest
-# exits with 0 if there is something interesting
+# 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
@@ -26,13 +28,14 @@ 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 +0.4 "$now" > "$now_s"
-sort +0.4 "$before" > "$before_s"
+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 '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
+grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -12 $tmp1 - >$tmp2
grep -s . $tmp2 >/dev/null
if [ $? = 0 ]; then
@@ -40,10 +43,11 @@ if [ $? = 0 ]; then
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 '^PASS' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
+grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -12 $tmp1 - >$tmp2
grep -s . $tmp2 >/dev/null
if [ $? = 0 ]; then
@@ -53,8 +57,8 @@ if [ $? = 0 ]; then
echo
fi
-grep '^FAIL' "$now_s" | sed 's/^....: //' >$tmp1
-grep '^[PF]A[SI][SL]' "$before_s" | sed 's/^....: //' | comm -23 $tmp1 - >$tmp2
+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
@@ -62,10 +66,11 @@ if [ $? = 0 ]; then
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 '^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
@@ -75,8 +80,8 @@ if [ $? = 0 ]; then
echo
fi
-grep '^[PF]A[SI][SL]' "$now_s" | sed 's/^....: //' >$tmp1
-grep '^PASS' "$before_s" | sed 's/^....: //' | comm -13 $tmp1 - >$tmp2
+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
@@ -86,8 +91,8 @@ if [ $? = 0 ]; then
echo
fi
-grep '^[PF]A[SI][SL]' "$now_s" | sed 's/^....: //' >$tmp1
-grep '^FAIL' "$before_s" | sed 's/^....: //' | comm -13 $tmp1 - >$tmp2
+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
@@ -96,3 +101,5 @@ if [ $? = 0 ]; then
cat $tmp2
echo
fi
+
+exit $exit_status