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