chiark / gitweb /
+ Bugfixes:
[adns.git] / regress / r1test
index de8db693792b16d66d7f659d0ec9b55d3e4c629f..57df4bbdcf0a1442d8796635c63484f82c1c3a37 100755 (executable)
@@ -1,5 +1,27 @@
 #!/bin/sh
 # usage: r1test <testcasename>
+# test execution script, for running one test
+#
+#  This file is
+#    Copyright (C) 1998-2000 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+#  It is part of adns, which is
+#    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#  
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2, or (at your option)
+#  any later version.
+#  
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#  
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
 
 set -e
 mrc=1
@@ -28,7 +50,7 @@ set -e
 
 if [ "$rc" = 5 ]
 then
-       echo -n "SKIPPED-$casename "
+       printf "SKIPPED-$casename "
        mrc=5
        exit
 fi
@@ -42,16 +64,23 @@ do
        then
                :
        else
-               failed=true
+               failwhy="$failwhy WRONG OUTPUT"
        fi
 done
 
-if $failed
+cat >"$ocase.leftover"
+if egrep . /dev/null "$ocase.leftover"
 then
-       echo >&2 "FAILED $case - WRONG OUTPUT - lines of syscall remaining `wc -l`"
+       failwhy="$failwhy EXITED EARLY"
+fi
+
+if [ "x$failwhy" != x ]
+then
+       scremain="`wc -l <\"$ocase.leftover\"`"
+       echo >&2 "FAILED $case -$failwhy - lines of syscall remaining $scremain"
        mrc=2
        exit
 fi
 
-echo -n "$casename "
+printf "$casename "
 mrc=0