chiark / gitweb /
Regression test doesn't rely on value of O_NONBLOCK.
[adns.git] / regress / m1test
index 361e5b17106d5a274dcfaf9ad3c3306d385eab37..81cd024fe6b6bc7e6fd2af7d95615b66aaa7af91 100755 (executable)
@@ -1,16 +1,30 @@
 #!/bin/sh
-# usage: m1test <name> <initfile> <queryargs>
 
 set -e
-tcn="$1"
-initfile="$2"
+
+if [ $# -lt 3 ]
+then
+       echo >&2 'usage: m1test <name> <initfile> <queryargs>'
+       exit 1
+fi
+
+case="case-$1"; shift
+initfile="$1"; shift
 queryargs="$*"
-test -d ../testcases || cd testcases
 
-initstring="`cat $initfile.init`"
+initstring="`cat init-$initfile.text`"
+
+echo "$initfile" >"$case.sys"
+echo "$queryargs" >>"$case.sys"
+
+echo running "hrecord /... $queryargs"
+set +e
+ADNS_TEST_OUT_FD=3 3>>"$case.sys" >"$case.out" 2>"$case.err" </dev/null \
+ ./hrecord "/$initstring" $queryargs
+rc=$?
+set -e
 
-exec >$tcn.log
-echo "$initfile"
-echo "$queryargs"
+echo "rc=$rc" >>$case.out
 
-H../hrecord "/$initstring" $queryargs
+egrep . -- "$case.err" "$case.out"
+echo "exit status: $rc"