chiark / gitweb /
Fix typo in changelog entry for 1.6.1
[adns.git] / regress / r1test
1 #!/bin/sh
2 # usage: r1test <testcasename>
3 # test execution script, for running one test
4 #
5 #  This file is part of adns, which is Copyright Ian Jackson
6 #  and contributors (see the file INSTALL for full details).
7 #  
8 #  This program is free software; you can redistribute it and/or modify
9 #  it under the terms of the GNU General Public License as published by
10 #  the Free Software Foundation; either version 3, or (at your option)
11 #  any later version.
12 #  
13 #  This program is distributed in the hope that it will be useful,
14 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #  GNU General Public License for more details.
17 #  
18 #  You should have received a copy of the GNU General Public License
19 #  along with this program; if not, write to the Free Software Foundation.
20
21 set -e
22 : ${srcdir=.}
23 . "$srcdir"/shlib
24 mrc=1
25 trap 'exit $mrc' 0
26
27 casename="$1"
28
29 playback_prepare
30
31 rm -f $ocase.*
32
33 EF_DISABLE_BANNER=1
34 export EF_DISABLE_BANNER
35
36 if test ! -e $playback
37 then
38         printf "SKIPPED-$casename "
39         mrc=5
40         exit
41 fi
42
43 playback_execute_hook () { :; }
44 playback_execute
45
46 if [ "$rc" = 5 ]
47 then
48         printf "SKIPPED-$casename "
49         mrc=5
50         exit
51 fi
52
53 echo "rc=$rc" >>$ocase.out
54
55 failed=false
56 for part in err out
57 do
58         if diff -u -- "$case.$part" "$ocase.$part"
59         then
60                 :
61         else
62                 failwhy="$failwhy WRONG OUTPUT"
63         fi
64 done
65
66 cat <&4 >"$ocase.leftover"
67 if egrep . /dev/null "$ocase.leftover"
68 then
69         failwhy="$failwhy EXITED EARLY"
70 fi
71
72 if [ "x$failwhy" != x ]
73 then
74         scremain="`wc -l <\"$ocase.leftover\"`"
75         echo >&2 "FAILED $case -$failwhy - lines of syscall remaining $scremain"
76         mrc=2
77         exit
78 fi
79
80 printf "$casename "
81 mrc=0