test-simple revision 1.5
1#! /bin/sh
2# $NetBSD: test-simple,v 1.5 2018/11/21 09:37:02 mrg Exp $
3
4test="$1"; shift
5bozohttpd="$1"; shift
6datadir="$1"; shift
7curdir="$1"; shift
8verbose="$1"; shift
9host="$1"; shift
10
11in="$curdir/$test.in"
12out="$curdir/$test.out"
13tmpout="tmp.$test.out"
14tmperr="tmp.$test.err"
15
16if [ "yes" = "$verbose" ]; then
17	echo "Running test $test"
18else
19	exec 2>"$tmperr"
20fi
21
22bozotestport=11111
23
24${bozohttpd} "$@" "${datadir}" "${host}" < "$in" > "$tmpout"
25if "$curdir/html_cmp" cmp "$out" "$tmpout"; then
26	exit 0
27else
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
34fi
35