source: rtems/c/src/tests/tools/generic/difftest @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on May 11, 1995 at 5:39:37 PM

Initial revision

  • Property mode set to 100644
File size: 1.7 KB
Line 
1#!/bin/ksh -p
2#
3# Check test results against official output in the src tree
4# $Id$
5#
6
7# XXX: do not run size.exe with this; it asks questions we don't answer
8
9# how to do arith in bash
10#    i=$((i * 2))
11#    b=$((b + 1))
12
13# progname=`basename $0`
14progname=${0##*/}        # fast basename hack for ksh, bash
15
16USAGE=\
17"usage: $progname [ -opts ] test [ test ... ]
18        -v          -- verbose
19        -l logdir   -- specify log directory (default is 'logdir')
20"
21
22#   log an error to stderr
23prerr()
24{
25    echo "$*" >&2
26}
27
28fatal() {
29    [ "$1" ] && prerr $*
30    prerr "$USAGE"
31    exit 1
32}
33
34warn() {
35    [ "$1" ] && prerr $*
36}
37
38#
39# process the options
40#
41# defaults for getopt vars
42#
43
44verbose=""
45logdir=log
46
47while getopts v12o:l: OPT
48do
49    case "$OPT" in
50        v)
51            verbose="yes";;
52        l)
53            logdir="$OPTARG";;
54        *)
55            fatal;;
56    esac
57done
58((shiftcount = $OPTIND - 1))
59shift $shiftcount
60
61args=$*
62
63#
64# Run the tests
65#
66
67cd $RTEMS_ROOT/c/$RTEMS_BSP/tests/$logdir ||
68  fatal "No log directory: $RTEMS_ROOT/c/$RTEMS_BSP/tests/$logdir"
69
70tests="$args"
71if [ ! "$tests" ]
72then
73     set -- `echo sp?? mp??_?`
74     tests="$*"
75fi
76
77for t in $tests
78do
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
103done
104
105exit 0
106
107# Local Variables: ***
108# mode:ksh ***
109# End: ***
110
Note: See TracBrowser for help on using the repository browser.