4.104.114.84.95
Rev | Line | |
---|
[5c491aef] | 1 | #!KSHELL -p |
---|
[ac7d5ef0] | 2 | # |
---|
[5c491aef] | 3 | # Check test results against official output in the src tree |
---|
[8389628] | 4 | # |
---|
[5c491aef] | 5 | # $Id$ |
---|
[ac7d5ef0] | 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 |
---|
[c64e4ed4] | 59 | shiftcount=`expr $OPTIND - 1` |
---|
[ac7d5ef0] | 60 | shift $shiftcount |
---|
| 61 | |
---|
| 62 | args=$* |
---|
| 63 | |
---|
| 64 | # |
---|
| 65 | # Run the tests |
---|
| 66 | # |
---|
| 67 | |
---|
[8389628] | 68 | cd $RTEMS_HOME/tests/$logdir || fatal "No log directory: $RTEMS_HOME/tests/$logdir" |
---|
[ac7d5ef0] | 69 | |
---|
| 70 | tests="$args" |
---|
| 71 | if [ ! "$tests" ] |
---|
| 72 | then |
---|
| 73 | set -- `echo sp?? mp??_?` |
---|
| 74 | tests="$*" |
---|
| 75 | fi |
---|
| 76 | |
---|
| 77 | for t in $tests |
---|
| 78 | do |
---|
| 79 | logfile=$t |
---|
| 80 | |
---|
| 81 | if [ ! -f $logfile ] |
---|
| 82 | then |
---|
| 83 | continue |
---|
| 84 | fi |
---|
| 85 | |
---|
| 86 | echo $logfile |
---|
| 87 | echo |
---|
| 88 | |
---|
| 89 | case $t in |
---|
| 90 | mp*) |
---|
| 91 | mptest=`echo $t | sed 's/_.//'` |
---|
| 92 | node=`echo $t | sed 's/...._//'` |
---|
| 93 | scn_file=$RTEMS_ROOT/c/src/tests/mptests/$mptest/node$node/$mptest.scn;; |
---|
| 94 | sp*) |
---|
| 95 | scn_file=$RTEMS_ROOT/c/src/tests/sptests/$t/$t.scn;; |
---|
| 96 | *) |
---|
| 97 | fatal "unknown test $t";; |
---|
| 98 | esac |
---|
| 99 | |
---|
| 100 | sed -e '/^$/d' < $logfile | diff -b $scn_file - |
---|
| 101 | echo |
---|
| 102 | echo |
---|
| 103 | done |
---|
| 104 | |
---|
| 105 | exit 0 |
---|
| 106 | |
---|
| 107 | # Local Variables: *** |
---|
| 108 | # mode:ksh *** |
---|
| 109 | # End: *** |
---|
| 110 | |
---|
Note: See
TracBrowser
for help on using the repository browser.