More Cilk Plus removal
[gcc.git] / contrib / compare_tests
index 2fc6e056fc62818581fddaa40a2540a7863f5a8e..51a3719ff6a832778f6dafd5944dd172242cbc64 100755 (executable)
@@ -2,6 +2,9 @@
 # This script automatically test the given tool with the tool's test cases,
 # reporting anything of interest.
 
+# Written by Mike Stump <mrs@cygnus.com>
+# Subdir comparison added by Quentin Neill <quentin.neill@amd.com>
+
 usage()
 {
        if [ -n "$1" ] ; then
@@ -29,22 +32,22 @@ EOUSAGE
        exit 2
 }
 
-# Written by Mike Stump <mrs@cygnus.com>
-# Subdir comparison added by Quentin Neill <quentin.neill@amd.com>
+export LC_ALL=C
 
 tool=gxx
 
-tmp1=/tmp/$tool-testing.$$a
-tmp2=/tmp/$tool-testing.$$b
-now_s=/tmp/$tool-testing.$$d
-before_s=/tmp/$tool-testing.$$e
-lst1=/tmp/$tool-lst1.$$
-lst2=/tmp/$tool-lst2.$$
-lst3=/tmp/$tool-lst3.$$
-lst4=/tmp/$tool-lst4.$$
-lst5=/tmp/$tool-lst5.$$
-sum1=/tmp/$tool-sum1.$$
-sum2=/tmp/$tool-sum2.$$
+TMPDIR=${TMPDIR:-/tmp}
+tmp1=$TMPDIR/$tool-testing.$$a
+tmp2=$TMPDIR/$tool-testing.$$b
+now_s=$TMPDIR/$tool-testing.$$d
+before_s=$TMPDIR/$tool-testing.$$e
+lst1=$TMPDIR/$tool-lst1.$$
+lst2=$TMPDIR/$tool-lst2.$$
+lst3=$TMPDIR/$tool-lst3.$$
+lst4=$TMPDIR/$tool-lst4.$$
+lst5=$TMPDIR/$tool-lst5.$$
+sum1=$TMPDIR/$tool-sum1.$$
+sum2=$TMPDIR/$tool-sum2.$$
 tmps="$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2"
 
 [ "$1" = "-strict" ] && strict=$1 && shift
@@ -55,8 +58,8 @@ trap "rm -f $tmps" 0 1 2 3 5 9 13 15
 exit_status=0
 
 if [ -d "$1" -a -d "$2" ] ; then
-       find "$1" -name '*.sum' >$lst1
-       find "$2" -name '*.sum' >$lst2
+       find "$1/" -name '*.sum' >$lst1
+       find "$2/" -name '*.sum' >$lst2
        echo "# Comparing directories"
        echo "## Dir1=$1: `cat $lst1 | wc -l` sum files"
        echo "## Dir2=$2: `cat $lst2 | wc -l` sum files"
@@ -105,8 +108,8 @@ elif [ -d "$1" -o -d "$2" ] ; then
        usage "Must specify either two directories or two files"
 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
+sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$1" | awk '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp1
+sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$2" | awk '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp2
 
 before=$tmp1
 now=$tmp2