1998-07-27 23:12:03 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# This script automatically test the given tool with the tool's test cases,
|
|
|
|
# reporting anything of interest.
|
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
# exits with 0 if there is nothing of interest
|
|
|
|
# exits with 1 if there is something interesting
|
1998-07-27 23:12:03 +02:00
|
|
|
# exits with 2 if an error occurred
|
|
|
|
|
|
|
|
# Give two .sum files to compare them
|
|
|
|
|
|
|
|
# Written by Mike Stump <mrs@cygnus.com>
|
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
tool=gxx
|
|
|
|
|
1998-07-27 23:12:03 +02:00
|
|
|
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
|
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
exit_status=0
|
1998-07-27 23:12:03 +02:00
|
|
|
trap "rm -f $tmp1 $tmp2 $now_s $before_s" 0 1 2 3 5 9 13 15
|
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
sort -t ':' +1 "$now" > "$now_s"
|
|
|
|
sort -t ':' +1 "$before" > "$before_s"
|
1998-07-27 23:12:03 +02:00
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
grep '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
|
|
|
|
grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -12 $tmp1 - >$tmp2
|
1998-07-27 23:12:03 +02:00
|
|
|
|
|
|
|
grep -s . $tmp2 >/dev/null
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
echo "Tests that now fail, but worked before:"
|
|
|
|
echo
|
|
|
|
cat $tmp2
|
|
|
|
echo
|
2003-04-05 00:49:10 +02:00
|
|
|
exit_status=1
|
1998-07-27 23:12:03 +02:00
|
|
|
fi
|
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
grep '^PASS' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
|
|
|
|
grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -12 $tmp1 - >$tmp2
|
1998-07-27 23:12:03 +02:00
|
|
|
|
|
|
|
grep -s . $tmp2 >/dev/null
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
echo "Tests that now work, but didn't before:"
|
|
|
|
echo
|
|
|
|
cat $tmp2
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
grep '^FAIL' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
|
|
|
|
grep '^[PF]A[SI][SL]' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -23 $tmp1 - >$tmp2
|
1998-07-27 23:12:03 +02:00
|
|
|
|
|
|
|
grep -s . $tmp2 >/dev/null
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
echo "New tests that FAIL:"
|
|
|
|
echo
|
|
|
|
cat $tmp2
|
|
|
|
echo
|
2003-04-05 00:49:10 +02:00
|
|
|
exit_status=1
|
1998-07-27 23:12:03 +02:00
|
|
|
fi
|
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
grep '^PASS' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
|
|
|
|
grep '^[PF]A[SI][SL]' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -23 $tmp1 - >$tmp2
|
1998-07-27 23:12:03 +02:00
|
|
|
|
|
|
|
grep -s . $tmp2 >/dev/null
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
echo "New tests that PASS:"
|
|
|
|
echo
|
|
|
|
cat $tmp2
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
grep '^[PF]A[SI][SL]' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
|
|
|
|
grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -13 $tmp1 - >$tmp2
|
1998-07-27 23:12:03 +02:00
|
|
|
|
|
|
|
grep -s . $tmp2 >/dev/null
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
echo "Old tests that passed, that have disappeared: (Eeek!)"
|
|
|
|
echo
|
|
|
|
cat $tmp2
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2003-04-05 00:49:10 +02:00
|
|
|
grep '^[PF]A[SI][SL]' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
|
|
|
|
grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -13 $tmp1 - >$tmp2
|
1998-07-27 23:12:03 +02:00
|
|
|
|
|
|
|
grep -s . $tmp2 >/dev/null
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
echo "Old tests that failed, that have disappeared: (Eeek!)"
|
|
|
|
echo
|
|
|
|
cat $tmp2
|
|
|
|
echo
|
|
|
|
fi
|
2003-04-05 00:49:10 +02:00
|
|
|
|
|
|
|
exit $exit_status
|