X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=userapps%2Fopensource%2Fnet-snmp%2Ftesting%2Feval_oneprogram.sh;fp=userapps%2Fopensource%2Fnet-snmp%2Ftesting%2Feval_oneprogram.sh;h=0000000000000000000000000000000000000000;hb=cf3b25a5003e531e4599b2a56fa007f272198570;hp=45edfc0a673d8b8aaf530ce9fd1cef3e0383b60d;hpb=59e02c1be2c9b373846b0789fbd5b7ef46f0927f;p=bcm963xx.git diff --git a/userapps/opensource/net-snmp/testing/eval_oneprogram.sh b/userapps/opensource/net-snmp/testing/eval_oneprogram.sh deleted file mode 100755 index 45edfc0a..00000000 --- a/userapps/opensource/net-snmp/testing/eval_oneprogram.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/sh -# -# eval_oneprogram.sh [-h][-lk] [] -# -# CALLED BY: eval_suite.sh -# -# -# Runs and reports how many instances of the strings SUCCESS -# or FAILED occur. -# -# -# FIX Output from $PROGRAM on stderr is separated out and comes first. -# -# -USAGE_LONG=' -# -# -h Help. -# -k Save the program output in "____o". -# -l Long form. (Short form by default.) -# -# is the executable to run and collect the output of. -' - -USAGE="Usage: `basename $0` [-h][-lk] " - - - - -#------------------------------------ -o- -# Globals. -# -AWKFILE="_`basename $0`$$.awk" -SCRIPTFILE= - -dolongform=0 -dokeepoutput= - -TOTALFAILED=0 - - - -#------------------------------------ -o- -# Parse & setup. -# -while [ -n "$1" ]; do - case "$1" in - -k) dokeepoutput=true - ;; - -l) dolongform=1 - ;; - -h) echo $USAGE - cat <&2 -$USAGE_LONG -BLIK - exit 0 - ;; - *) PROGRAM="$*" - shift `expr $# - 1` - ;; - esac - - shift -done - -[ -z "$PROGRAM" ] && echo $USAGE && exit 1 - - -SCRIPTFILE="__`echo \`basename $PROGRAM\` | sed 's/ /_/g'`__$$o" - - - -#------------------------------------ -o- -# Create awk script. -# - -cat <$AWKFILE - -BEGIN { - pass = 0 - passlist[0] = "" - - fail = 0 - faillist[0] = "" - - longform = $dolongform + 0 -} - -/SUCCESS/ { - passlist[pass] = \$0 - pass += 1 -} - -/FAILED/ { - faillist[fail] = \$0 - fail += 1 -} - -END { - printf "$PROGRAM SUCCESS: %d\n", pass - printf "$PROGRAM FAILED: %d\n", fail - - if (longform) { - printf "\n" - for (i=0; i&1 ; } >$SCRIPTFILE - -awk -f $AWKFILE $SCRIPTFILE -TOTALFAILED=$? - -rm -f $AWKFILE -[ -z "$dokeepoutput" ] && rm -f $SCRIPTFILE - - - - -#------------------------------------ -o- -# Exit, cleanup. -# -exit $TOTALFAILED - -