#!/bin/bash

. ../functions

[ "$TEST_VERBOSE" ] || TEST_VERBOSE=0
log() {
	if [ $TEST_VERBOSE -gt 1 ]; then
		echo "$@" 1>&2
	fi
}

NONINTERACTIVE="yes"

test="$1"
DIR=$PWD
TEST_DIR=$PWD/$(dirname "$test")
tmp=$(tempfile)
unset HOSTNAME
. $test.test "$tmp"
cd $DIR
if $(cmp -s $test.preseed $tmp); then
	rm -f $tmp
	exit 0
else
	if [ $TEST_VERBOSE ]; then
		diff -urN $test.preseed $tmp 1>&2
	fi
	rm -f $tmp
	exit 1
fi

