11.1Sschmonz#! /bin/sh
21.6Smaya# $NetBSD: test-simple,v 1.6 2018/12/14 23:57:22 maya Exp $
31.1Sschmonz
41.4Smrgtest="$1"; shift
51.4Smrgbozohttpd="$1"; shift
61.4Smrgdatadir="$1"; shift
71.4Smrgcurdir="$1"; shift
81.4Smrgverbose="$1"; shift
91.4Smrg
101.4Smrgin="$curdir/$test.in"
111.4Smrgout="$curdir/$test.out"
121.4Smrgtmpout="tmp.$test.out"
131.4Smrgtmperr="tmp.$test.err"
141.1Sschmonz
151.1Sschmonzif [ "yes" = "$verbose" ]; then
161.1Sschmonz	echo "Running test $test"
171.1Sschmonzelse
181.4Smrg	exec 2>"$tmperr"
191.1Sschmonzfi
201.1Sschmonz
211.1Sschmonzbozotestport=11111
221.1Sschmonz
231.6Smaya${bozohttpd} "$@" "${datadir}" < "$in" > "$tmpout"
241.4Smrgif "$curdir/html_cmp" cmp "$out" "$tmpout"; then
251.1Sschmonz	exit 0
261.1Sschmonzelse
271.4Smrg	if [ "yes" = "$verbose" ]; then
281.4Smrg		echo "Failed test $test:"
291.4Smrg		cat "$tmperr"
301.4Smrg		$curdir/html_cmp diff "$out" "$tmpout"
311.4Smrg	fi
321.2Sschmonz	exit 1
331.1Sschmonzfi
34