3 # eval_oneprogram.sh [-h][-lk] <program> [<program_args>]
5 # CALLED BY: eval_suite.sh
8 # Runs <program> and reports how many instances of the strings SUCCESS
12 # FIX Output from $PROGRAM on stderr is separated out and comes first.
18 # -k Save the program output in "__<program_args>__<pid>o".
19 # -l Long form. (Short form by default.)
21 # <program> is the executable to run and collect the output of.
24 USAGE="Usage: `basename $0` [-h][-lk] <program>"
29 #------------------------------------ -o-
32 AWKFILE="_`basename $0`$$.awk"
42 #------------------------------------ -o-
52 cat <<BLIK | sed 's/^#//' | sed '1d' 1>&2
65 [ -z "$PROGRAM" ] && echo $USAGE && exit 1
68 SCRIPTFILE="__`echo \`basename $PROGRAM\` | sed 's/ /_/g'`__$$o"
72 #------------------------------------ -o-
85 longform = $dolongform + 0
99 printf "$PROGRAM SUCCESS: %d\n", pass
100 printf "$PROGRAM FAILED: %d\n", fail
104 for (i=0; i<pass; i++)
107 for (i=0; i<fail; i++)
118 #------------------------------------ -o-
119 # Get and print results.
122 { $PROGRAM $* 2>&1 ; } >$SCRIPTFILE
124 awk -f $AWKFILE $SCRIPTFILE
128 [ -z "$dokeepoutput" ] && rm -f $SCRIPTFILE
133 #------------------------------------ -o-