From: Peter Maydell Date: Thu, 25 Dec 2008 23:30:33 +0000 (+0000) Subject: test/runtest: automatically run setup-test if it hasn't already X-Git-Tag: PRE_POSIX_CONVERSION~18 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=5b32b30305e864c22241dc1740a79fda9c269db7;p=mmh test/runtest: automatically run setup-test if it hasn't already been done. Improve error handling in test script with 'set -e'. --- diff --git a/ChangeLog b/ChangeLog index d69cbca..e561c51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-03 Peter Maydell + + * test/runtest: automatically run setup-test if it hasn't already + been done. Improve error handling in test script with 'set -e'. + 2008-10-23 David Levine * h/mh.h: raised NAMESZ from 128 to 999. RFC 2822 limits line diff --git a/test/runtest b/test/runtest index 21feb73..4ec4a03 100755 --- a/test/runtest +++ b/test/runtest @@ -1,6 +1,20 @@ #!/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 @@ -23,9 +37,10 @@ EOF done # now run the test +set +e /bin/sh $1 - return_value=$? +set -e if [ $return_value -eq 0 ] ; then echo Test $1 PASS