X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fsubr.sh;h=84ee1a4b8955d637c09520750b4f43aff25848c5;hb=5762f26aae78beaead9919074963f67d92794599;hp=c0e67f8e1288449110819659deca46b7df6ad04b;hpb=dca20740848a3e316371460a25be29fd574850ed;p=sbcl.git diff --git a/tests/subr.sh b/tests/subr.sh index c0e67f8..84ee1a4 100644 --- a/tests/subr.sh +++ b/tests/subr.sh @@ -33,7 +33,8 @@ 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_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