summaryrefslogtreecommitdiff
path: root/libexec/httpd/testsuite/test-simple
blob: 200b09f7de401d9b230b2dd8eca11faceb9bb640 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /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