source: trunk/src/gcc/contrib/compare_tests@ 1214

Last change on this file since 1214 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.2 KB
RevLine 
[2]1#!/bin/sh
2# This script automatically test the given tool with the tool's test cases,
3# reporting anything of interest.
4
5# exits with 1 if there is nothing of interest
6# exits with 0 if there is something interesting
7# exits with 2 if an error occurred
8
9# Give two .sum files to compare them
10
11# Written by Mike Stump <[email protected]>
12
13tmp1=/tmp/$tool-testing.$$a
14tmp2=/tmp/$tool-testing.$$b
15now_s=/tmp/$tool-testing.$$d
16before_s=/tmp/$tool-testing.$$e
17
18if [ "$2" = "" ]; then
19 echo "Usage: $0 previous current" >&2
20 exit 2
21fi
22
23sed 's/^XFAIL/FAIL/; s/^XPASS/PASS/' < "$1" >$tmp1
24sed 's/^XFAIL/FAIL/; s/^XPASS/PASS/' < "$2" >$tmp2
25
26before=$tmp1
27now=$tmp2
28
29trap "rm -f $tmp1 $tmp2 $now_s $before_s" 0 1 2 3 5 9 13 15
30
31sort +0.4 "$now" > "$now_s"
32sort +0.4 "$before" > "$before_s"
33
34grep '^FAIL' "$now_s" | sed 's/^....: //' >$tmp1
35grep '^PASS' "$before_s" | sed 's/^....: //' | comm -12 $tmp1 - >$tmp2
36
37grep -s . $tmp2 >/dev/null
38if [ $? = 0 ]; then
39 echo "Tests that now fail, but worked before:"
40 echo
41 cat $tmp2
42 echo
43fi
44
45grep '^PASS' "$now_s" | sed 's/^....: //' >$tmp1
46grep '^FAIL' "$before_s" | sed 's/^....: //' | comm -12 $tmp1 - >$tmp2
47
48grep -s . $tmp2 >/dev/null
49if [ $? = 0 ]; then
50 echo "Tests that now work, but didn't before:"
51 echo
52 cat $tmp2
53 echo
54fi
55
56grep '^FAIL' "$now_s" | sed 's/^....: //' >$tmp1