# usage: r1test <testcasename>
set -e
+mrc=1
+trap 'exit $mrc' 0
+
casename="$1"
case="case-$casename"
ocase="output-$casename"
exec <"$case.sys"
-read initfile
+read initfile initflags
read queryargs
initstring="`cat init-$initfile.text`"
rm -f $ocase.*
+EF_DISABLE_BANNER=1
+export EF_DISABLE_BANNER
+
set +e
ADNS_TEST_REPORT_FD=3 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \
- ./hplayback "/$initstring" $queryargs
+ ./hplayback $initflags "/$initstring" $queryargs
rc=$?
set -e
+if [ "$rc" = 5 ]
+then
+ echo -n "SKIPPED-$casename "
+ mrc=5
+ exit
+fi
+
echo "rc=$rc" >>$ocase.out
failed=false
then
:
else
- failed=true
+ failwhy="$failwhy WRONG OUTPUT"
fi
done
-if $failed
+cat >"$ocase.leftover"
+if egrep . /dev/null "$ocase.leftover"
then
- echo >&2 "FAILED $case - WRONG OUTPUT - lines of syscall remaining `wc -l`"
- exit 2
+ failwhy="$failwhy EXITED EARLY"
fi
-echo -n "$casename "
+if [ "x$failwhy" != x ]
+then
+ scremain="`wc -l <\"$ocase.leftover\"`"
+ echo >&2 "FAILED $case -$failwhy - lines of syscall remaining $scremain"
+ mrc=2
+ exit
+fi
-exit 0
+echo -n "$casename "
+mrc=0