#! /bin/sh # $NetBSD: test-simple,v 1.6 2018/12/14 23:57:22 maya Exp $ test="$1"; shift bozohttpd="$1"; shift datadir="$1"; shift curdir="$1"; shift verbose="$1"; shift in="$curdir/$test.in" out="$curdir/$test.out" tmpout="tmp.$test.out" tmperr="tmp.$test.err" if [ "yes" = "$verbose" ]; then echo "Running test $test" else exec 2>"$tmperr" fi bozotestport=11111 ${bozohttpd} "$@" "${datadir}" < "$in" > "$tmpout" if "$curdir/html_cmp" cmp "$out" "$tmpout"; then exit 0 else if [ "yes" = "$verbose" ]; then echo "Failed test $test:" cat "$tmperr" $curdir/html_cmp diff "$out" "$tmpout" fi exit 1 fi |