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 3, 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.
30 case="$srcdir/case-$casename"
31 ocase="output-$casename"
34 read <&4 program initfile initflags
37 initstring="`cat $srcdir/init-$initfile.text`"
38 xinitflagsf=$srcdir/$program-xinitflags.text
39 if test -f $xinitflagsf
41 initflags="$initflags `cat $xinitflagsf`";
43 initflags="$initflags /"
49 export EF_DISABLE_BANNER
58 playback=./${program}_playback
59 if test ! -f $playback
61 printf "SKIPPED-$casename "
67 ADNS_TEST_REPORT_FD=3 ADNS_TEST_IN_FD=4 \
68 3>>"$ocase.report" 4<&4 >"$ocase.out" 2>"$ocase.err" \
69 $ADNS_TEST_DEBUG $playback $initflags"$initstring" $queryargs
75 printf "SKIPPED-$casename "
80 echo "rc=$rc" >>$ocase.out
85 if diff -u -- "$case.$part" "$ocase.$part"
89 failwhy="$failwhy WRONG OUTPUT"
93 cat <&4 >"$ocase.leftover"
94 if egrep . /dev/null "$ocase.leftover"
96 failwhy="$failwhy EXITED EARLY"
99 if [ "x$failwhy" != x ]
101 scremain="`wc -l <\"$ocase.leftover\"`"
102 echo >&2 "FAILED $case -$failwhy - lines of syscall remaining $scremain"