Update copyright dates to 2000.
[adns] / regress / r1test
... / ...
CommitLineData
1#!/bin/sh
2# usage: r1test <testcasename>
3# test execution script, for running one test
4#
5# This file is
6# Copyright (C) 1998-2000 Ian Jackson <ian@davenant.greenend.org.uk>
7#
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>
11#
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)
15# any later version.
16#
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.
21#
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.
25
26set -e
27mrc=1
28trap 'exit $mrc' 0
29
30casename="$1"
31case="case-$casename"
32ocase="output-$casename"
33
34exec <"$case.sys"
35read program initfile initflags
36read queryargs
37
38initstring="`cat init-$initfile.text`"
39xinitflagsf=$program-xinitflags.text
40if test -f $xinitflagsf
41then
42 initflags="$initflags $(cat $xinitflagsf)";
43else
44 initflags="$initflags /"
45fi
46
47rm -f $ocase.*
48
49EF_DISABLE_BANNER=1
50export EF_DISABLE_BANNER
51
52set +e
53ADNS_TEST_REPORT_FD=3 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \
54 ./${program}_playback $initflags"$initstring" $queryargs
55rc=$?
56set -e
57
58if [ "$rc" = 5 ]
59then
60 printf "SKIPPED-$casename "
61 mrc=5
62 exit
63fi
64
65echo "rc=$rc" >>$ocase.out
66
67failed=false
68for part in err out
69do
70 if diff -u -- "$case.$part" "$ocase.$part"
71 then
72 :
73 else
74 failwhy="$failwhy WRONG OUTPUT"
75 fi
76done
77
78cat >"$ocase.leftover"
79if egrep . /dev/null "$ocase.leftover"
80then
81 failwhy="$failwhy EXITED EARLY"
82fi
83
84if [ "x$failwhy" != x ]
85then
86 scremain="`wc -l <\"$ocase.leftover\"`"
87 echo >&2 "FAILED $case -$failwhy - lines of syscall remaining $scremain"
88 mrc=2
89 exit
90fi
91
92printf "$casename "
93mrc=0