1 #! /bin/sh 2 # $NetBSD: test-simple,v 1.2.6.4 2018/11/24 17:23:48 martin Exp $ 3 4 test="$1"; shift 5 bozohttpd="$1"; shift 6 datadir="$1"; shift 7 curdir="$1"; shift 8 verbose="$1"; shift 9 host="$1"; shift 10 11 in="$curdir/$test.in" 12 out="$curdir/$test.out" 13 tmpout="tmp.$test.out" 14 tmperr="tmp.$test.err" 15 16 if [ "yes" = "$verbose" ]; then 17 echo "Running test $test" 18 else 19 exec 2>"$tmperr" 20 fi 21 22 bozotestport=11111 23 24 ${bozohttpd} "$@" "${datadir}" "${host}" < "$in" > "$tmpout" 25 if "$curdir/html_cmp" cmp "$out" "$tmpout"; then 26 exit 0 27 else 28 if [ "yes" = "$verbose" ]; then 29 echo "Failed test $test:" 30 cat "$tmperr" 31 $curdir/html_cmp diff "$out" "$tmpout" 32 fi 33 exit 1 34 fi 35