X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fsubr.sh;h=8d1d1be46bff7a8ba41bba01f21f33504207bc19;hb=260de2062fca170efdac3e42491d7d866c2d2e56;hp=c0e67f8e1288449110819659deca46b7df6ad04b;hpb=dca20740848a3e316371460a25be29fd574850ed;p=sbcl.git diff --git a/tests/subr.sh b/tests/subr.sh index c0e67f8..8d1d1be 100644 --- a/tests/subr.sh +++ b/tests/subr.sh @@ -26,15 +26,17 @@ set -u set -a # export all variables at assignment-time. # Note: any script that uses the variables that name files should # quote them (with double quotes), to contend with whitespace. -SBCL_HOME="$SBCL_PWD/../contrib" -SBCL_CORE="$SBCL_PWD/../output/sbcl.core" -SBCL_RUNTIME="$SBCL_PWD/../src/runtime/sbcl" -SBCL_ARGS="--noinform --no-sysinit --no-userinit --noprint --disable-debugger" +SBCL_HOME="${TEST_SBCL_HOME:-$SBCL_PWD/../obj/sbcl-home}" +SBCL_CORE="${TEST_SBCL_CORE:-$SBCL_PWD/../output/sbcl.core}" +SBCL_RUNTIME="${TEST_SBCL_RUNTIME:-$SBCL_PWD/../src/runtime/sbcl}" +SBCL_ARGS="${TEST_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_DIRECTORY="$SBCL_PWD/$TEST_FILESTEM-$$" +TEST_BASENAME=`basename $0` +TEST_FILESTEM=`basename "${TEST_BASENAME}" | sed -e 's/\.sh$//' -e 's/\./-/g'` +: ${TEST_BASEDIR:="$SBCL_PWD"} +TEST_DIRECTORY="${TEST_BASEDIR}/${TEST_FILESTEM}-$$" +export TEST_DIRECTORY # "Ten four" is the closest numerical slang I can find to "OK", so # it's the Unix status value that we expect from a successful test. @@ -65,6 +67,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 +125,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