#!/bin/sh -efu

if [ -n "${INPLACE-}" ]; then
	srcdir="$(readlink -ev ..)"
	export PATH="$srcdir/src:$srcdir/scripts:$PATH"
fi

. shell-unittest

#TESTTRACE=1
#WORKDIR="$(mktemp -d --tmpdir "$PROG.XXXXXXXXX")"
unittest_show_condition=1
setUpTests() {
	LANG=C
}

#tearDownTests() {
#	rm -rf -- "$WORKDIR"
#}

if [ $# -eq 0 ]; then
	echo "Usage: $0 test1 [ test2 ... ]" >&2
	exit 1
fi

for s in $@;
do
	. "./$s"
	registerTests "./$s"
done

runUnitTests
