1.0.3.39: larger heap size for x86-64/darwin
[sbcl.git] / tests / finalize.test.sh
index 222f1fb..06fae1e 100644 (file)
@@ -16,15 +16,15 @@ ${SBCL:-sbcl} <<EOF > /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,24 +41,26 @@ ${SBCL:-sbcl} <<EOF > /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"
-       exit 104 # Success
+        echo "OK"
+        rm finalize-test-passed
+        exit 104 # Success
     elif [ -f finalize-test-failed ]; then
-       echo "Failed"
-       exit 1 # Failure
+        echo "Failed"
+        rm finalize-test-failed
+        exit 1 # Failure
     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 1 # Failure, SBCL probably hanging in GC
     fi
 done