2 # usage: r1test <testcasename>
3 # test execution script, for running one test
5 # This file is part of adns, which is
6 # Copyright (C) 1997-2000,2003,2006 Ian Jackson
7 # Copyright (C) 1999-2000,2003,2006 Tony Finch
8 # Copyright (C) 1991 Massachusetts Institute of Technology
9 # (See the file INSTALL for full details.)
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2, or (at your option)
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software Foundation,
23 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 case="$srcdir/case-$casename"
32 ocase="output-$casename"
35 read <&4 program initfile initflags
38 initstring="`cat $srcdir/init-$initfile.text`"
39 xinitflagsf=$srcdir/$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" 4<&4 >"$ocase.out" 2>"$ocase.err" \
70 $ADNS_TEST_DEBUG $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"