X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ffinalize.test.sh;h=ded7232df4cdb9b9880a1e7a6602dba467773fd0;hb=cf49f2d086069a9c1b57f501df9a6a0bd3a34c3c;hp=5c7e4fedcd380078abba3652e57b8a992642561e;hpb=b41f8c974ccfba8a59ec2a6af843e8869e14be5f;p=sbcl.git diff --git a/tests/finalize.test.sh b/tests/finalize.test.sh index 5c7e4fe..ded7232 100644 --- a/tests/finalize.test.sh +++ b/tests/finalize.test.sh @@ -4,11 +4,14 @@ # hang the test-suite, as the typical failure mode used to be SBCL # hanging uninterruptible in GC. -echo //entering finalize.test.sh +. ./subr.sh + +use_test_subdirectory -rm -f finalize-test-passed finalize-test-failed +echo //entering finalize.test.sh -${SBCL:-sbcl} < /dev/null & +# $! is not set correctly when calling run_sbcl, do it directly +"$SBCL_RUNTIME" --core "$SBCL_CORE" $SBCL_ARGS < /dev/null & (defvar *tmp* 0.0) (defvar *count* 0) @@ -16,15 +19,15 @@ ${SBCL:-sbcl} < /dev/null & (declare (ignore _)) nil) -(let ((junk (mapcar (lambda (_) - (declare (ignore _)) - (let ((x (gensym))) - (finalize x (lambda () - ;; cons in finalizer - (setf *tmp* (make-list 10000)) - (incf *count*))) - x)) - (make-list 10000)))) +(let ((junk (mapcar (compile nil '(lambda (_) + (declare (ignore _)) + (let ((x (gensym))) + (finalize x (lambda () + ;; cons in finalizer + (setf *tmp* (make-list 10000)) + (incf *count*))) + x))) + (make-list 10000)))) (setf junk (foo junk)) (foo junk)) @@ -41,26 +44,26 @@ ${SBCL:-sbcl} < /dev/null & EOF SBCL_PID=$! -WAITED=0 +WAITED=x echo "Waiting for SBCL to finish stress-testing finalizers" while true; do if [ -f finalize-test-passed ]; then - echo "OK" - rm finalize-test-passed - exit 104 # Success + echo "OK" + rm finalize-test-passed + exit $EXIT_TEST_WIN elif [ -f finalize-test-failed ]; then - echo "Failed" - rm finalize-test-failed - exit 1 # Failure + echo "Failed" + rm finalize-test-failed + exit $EXIT_LOSE fi sleep 1 - WAITED=$(($WAITED+1)) - if (($WAITED>60)); then - echo - echo "timeout, killing SBCL" - kill -9 $SBCL_PID - exit 1 # Failure, SBCL probably hanging in GC + WAITED="x$WAITED" + if [ $WAITED = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ]; then + echo + echo "timeout, killing SBCL" + kill -9 $SBCL_PID + exit $EXIT_LOSE # Failure, SBCL probably hanging in GC fi done