#!/bin/sh
+set -e
+
+if [ ! -e test-temp-dir ]; then
+ echo "test-temp-dir not found: running setup-test"
+ ./setup-test
+fi
+
export MH_TEST_DIR=`cat test-temp-dir`
+
+if [ ! -e "$MH_TEST_DIR/bld/Makefile" ]; then
+ echo "temporary directory missing or broken: running setup-test"
+ ./setup-test
+ export MH_TEST_DIR=`cat test-temp-dir`
+fi
+
export MH=$MH_TEST_DIR/mh_profile
export PATH=$MH_TEST_DIR/bin:$PATH
done
# now run the test
+set +e
/bin/sh $1
-
return_value=$?
+set -e
if [ $return_value -eq 0 ] ; then
echo Test $1 PASS
+elif [ $return_value -eq 120 ]; then
+ # indicates test was skipped (eg needed program not found)
+ # test itself should have printed a message about this,
+ # so print nothing here.
+ :
else
echo Test $1 FAIL
fi