#!/bin/sh
SCRIPT=`basename $0`

if [ -f test.gz ]; then
	(set -x;gzip -d test.gz)
	(set -x;chmod +x test)
fi
if [ ! -f test -o ! -x test ]; then
	echo "$SCRIPT: This doesn't appear to be the startalk examples" >&2
	exit 1;
fi

if [ ! -d test.d ]; then
	echo "$SCRIPT: There doesn't appear to be a test.d test subdirectory" >&2
	exit 1;
fi

cd test.d

if [ ! -f 01.ok ]; then
	(set -x; touch 01.ok)
fi

if [ ! -f 02.ok ]; then
	(set -x; touch 02.ok)
fi

if [ ! -f 12.ok ]; then
	(set -x; touch 12.ok)
fi

if [ ! -f 14.ok ]; then
	(set -x; touch 14.ok)
fi

if [ ! -f 30.ok ]; then
	(set -x; touch 30.ok)
fi

if [ ! -f 31.ok ]; then
	(set -x; touch 31.ok)
fi

if [ ! -f 32.ok ]; then
	(set -x; touch 32.ok)
fi

if [ ! -f 33.ok ]; then
	(set -x; touch 33.ok)
fi

if [ ! -f 51.ok ]; then
	(set -x; touch 51.ok)
fi

if [ ! -f 99.ok ]; then
	(set -x; touch 99.ok)
fi

cd -

echo "$SCRIPT: The tests are now ready to run."
exit 0;
