From 047e229c954567c9a6ab9eb46882ff8ccd93dd8b Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Sun, 23 May 2010 17:03:02 +0200 Subject: testsuite: Fix cleanup Signed-off-by: Michael Buesch --- tests/run-tests.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 5179360..bca5592 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -8,8 +8,12 @@ basedir="$(dirname "$0")" tmpdir="/tmp/toprammer-test-$$" +cleanup_enabled=1 + function cleanup { + [ $cleanup_enabled -ne 0 ] || return + echo "Cleanup..." rm -Rf "$tmpdir" } @@ -224,13 +228,16 @@ function do_run_test # $1=device, $2=testscript while $(true); do test_init [ $? -eq 0 ] || break + cleanup_enabled=0 ( test_run ) - if [ $? -ne 0 ]; then + local res=$? + cleanup_enabled=1 + if [ $res -ne 0 ]; then test_exit ask "$current_test failed. RETRY?" [ $? -eq 0 ] && continue ask "Terminate testsuite?" - [ $? -eq 0 ] && exit 1 + [ $? -eq 0 ] && abort break fi test_exit -- cgit v1.2.3