X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fsubr.sh;h=84ee1a4b8955d637c09520750b4f43aff25848c5;hb=ef61e6c46ca429b84a61e90efcd7ac11261f92c7;hp=eaa86fa94328116a13be1e22ea4dcbbf2a8fc13b;hpb=a42922aef908a1b45ae5420d51b2ca7ee1bafb9e;p=sbcl.git diff --git a/tests/subr.sh b/tests/subr.sh index eaa86fa..84ee1a4 100644 --- a/tests/subr.sh +++ b/tests/subr.sh @@ -32,8 +32,9 @@ SBCL_RUNTIME="$SBCL_PWD/../src/runtime/sbcl" SBCL_ARGS="--noinform --no-sysinit --no-userinit --noprint --disable-debugger" # Scripts that use these variables should quote them. -TEST_BASENAME="$(basename $0)" -TEST_FILESTEM="$(echo ${TEST_BASENAME%.sh} | sed 's/\./-/g')" +TEST_BASENAME="`basename $0`" +TEST_FILESTEM="`basename "${TEST_BASENAME}" | sed 's/\.sh$//'`" +TEST_FILESTEM="`echo "${TEST_FILESTEM}" | sed 's/\./-/g'`" TEST_DIRECTORY="$SBCL_PWD/$TEST_FILESTEM-$$" # "Ten four" is the closest numerical slang I can find to "OK", so @@ -65,6 +66,11 @@ run_sbcl () ( fi ) +run_sbcl_with_args () ( + set -u + "$SBCL_RUNTIME" --core "$SBCL_CORE" "$@" +) + run_sbcl_with_core () ( set -u core="$1" @@ -118,6 +124,10 @@ check_status_maybe_lose () { # them consistently do so in subdirectories. Note that such tests # should not change their exit action, or do so only very carefully. use_test_subdirectory () { + if test -d "$TEST_DIRECTORY" + then + cleanup_test_subdirectory + fi mkdir "$TEST_DIRECTORY" cd "$TEST_DIRECTORY" trap "cleanup_test_subdirectory" EXIT