2 # usage: r1test <testcasename>
3 # test execution script, for running one test
6 # Copyright (C) 1998-2000 Ian Jackson <ian@davenant.greenend.org.uk>
8 # It is part of adns, which is
9 # Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
10 # Copyright (C) 1999 Tony Finch <dot@dotat.at>
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2, or (at your option)
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software Foundation,
24 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 ocase="output-$casename"
35 read <&4 program initfile initflags
38 initstring="`cat init-$initfile.text`"
39 xinitflagsf=$program-xinitflags.text
40 if test -f $xinitflagsf
42 initflags="$initflags $(cat $xinitflagsf)";
44 initflags="$initflags /"
50 export EF_DISABLE_BANNER
59 playback=./${program}_playback
60 if test ! -f $playback
62 printf "SKIPPED-$casename "
68 ADNS_TEST_REPORT_FD=3 ADNS_TEST_IN_FD=4 \
69 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \
70 $playback $initflags"$initstring" $queryargs
76 printf "SKIPPED-$casename "
81 echo "rc=$rc" >>$ocase.out
86 if diff -u -- "$case.$part" "$ocase.$part"
90 failwhy="$failwhy WRONG OUTPUT"
94 cat <&4 >"$ocase.leftover"
95 if egrep . /dev/null "$ocase.leftover"
97 failwhy="$failwhy EXITED EARLY"
100 if [ "x$failwhy" != x ]
102 scremain="`wc -l <\"$ocase.leftover\"`"
103 echo >&2 "FAILED $case -$failwhy - lines of syscall remaining $scremain"