4.104.114.84.95
Line | |
---|
1 | #!@KSH@ -p |
---|
2 | # |
---|
3 | # Check test results against official output from the src tree |
---|
4 | # |
---|
5 | # $Id$ |
---|
6 | # |
---|
7 | |
---|
8 | # XXX: do not run size.exe with this; it asks questions we don't answer |
---|
9 | |
---|
10 | # how to do arith in bash |
---|
11 | # i=$((i * 2)) |
---|
12 | # b=$((b + 1)) |
---|
13 | |
---|
14 | # progname=`basename $0` |
---|
15 | progname=${0##*/} # fast basename hack for ksh, bash |
---|
16 | |
---|
17 | USAGE=\ |
---|
18 | "usage: $progname [ -opts ] test [ test ... ] |
---|
19 | -v -- verbose |
---|
20 | -l logdir -- specify log directory (default is 'logdir') |
---|
21 | " |
---|
22 | |
---|
23 | # log an error to stderr |
---|
24 | prerr() |
---|
25 | { |
---|
26 | echo "$*" >&2 |
---|
27 | } |
---|
28 | |
---|
29 | fatal() { |
---|
30 | [ "$1" ] && prerr $* |
---|
31 | prerr "$USAGE" |
---|
32 | exit 1 |
---|
33 | } |
---|
34 | |
---|
35 | warn() { |
---|
36 | [ "$1" ] && prerr $* |
---|
37 | } |
---|
38 | |
---|
39 | # |
---|
40 | # process the options |
---|
41 | # |
---|
42 | # defaults for getopt vars |
---|
43 | # |
---|
44 | |
---|
45 | verbose="" |
---|
46 | logdir=log |
---|
47 | |
---|
48 | while getopts v12o:l: OPT |
---|
49 | do |
---|
50 | case "$OPT" in |
---|
51 | v) |
---|
52 | verbose="yes";; |
---|
53 | l) |
---|
54 | logdir="$OPTARG";; |
---|
55 | *) |
---|
56 | fatal;; |
---|
57 | esac |
---|
58 | done |
---|
59 | shiftcount=`expr $OPTIND - 1` |
---|
60 | shift $shiftcount |
---|
61 | |
---|
62 | args=$* |
---|
63 | |
---|
64 | # |
---|
65 | # Run the tests |
---|
66 | # |
---|
67 | |
---|
68 | test -d $logdir || fatal "No log directory: ./$logdir" |
---|
69 | |
---|
70 | tests="$args" |
---|
71 | if [ ! "$tests" ] |
---|
72 | then |
---|
73 | cd $logdir |
---|
74 | set -- `ls -1 sp* mp??_? psx* itron* mp*_?_g 2>/dev/null | grep -v info` |
---|
75 | cd .. |
---|
76 | tests="$*" |
---|
77 | fi |
---|
78 | |
---|
79 | for t in $tests |
---|
80 | do |
---|
81 | logfile=$t |
---|
82 | |
---|
83 | if [ ! -f $logdir/$logfile ] |
---|
84 | then |
---|
85 | continue |
---|
86 | fi |
---|
87 | |
---|
88 | echo $logfile |
---|
89 | echo |
---|
90 | |
---|
91 | case $t in |
---|
92 | mp*) |
---|
93 | mptest=`echo $t | sed 's/_.//'` |
---|
94 | node=`echo $t | sed 's/...._//'` |
---|
95 | tmp_scn_file=mptests/node$node/$mptest.scn;; |
---|
96 | sp*) |
---|
97 | tmp_scn_file=sptests/$t.scn;; |
---|
98 | psx*) |
---|
99 | tmp_scn_file=psxtests/$t.scn;; |
---|
100 | itron*) |
---|
101 | tmp_scn_file=itrontests/$t.scn;; |
---|
102 | *) |
---|
103 | fatal "unknown test $t";; |
---|
104 | esac |
---|
105 | |
---|
106 | scn_file=`echo $tmp_scn_file | sed -e s/_g//` |
---|
107 | sed -e '/^$/d' < $logdir/$logfile | diff -b screens/$scn_file - |
---|
108 | echo |
---|
109 | echo |
---|
110 | done |
---|
111 | |
---|
112 | exit 0 |
---|
113 | |
---|
114 | # Local Variables: *** |
---|
115 | # mode:ksh *** |
---|
116 | # End: *** |
---|
117 | |
---|
Note: See
TracBrowser
for help on using the repository browser.