3 # tests for problems in the interface presented to the user/programmer
5 # This software is part of the SBCL system. See the README file for
8 # While most of SBCL is derived from the CMU CL system, the test
9 # files (like this one) were written from scratch after the fork
12 # This software is in the public domain and is provided with
13 # absolutely no warranty. See the COPYING and CREDITS files for
20 tmpscript
=$TEST_FILESTEM.lisp-script
22 # Since we execute shell scripts with "set -u" by default
23 # (as performed in "subr.sh") this would correctly exit with
24 # an error if SBCL_MACHINE_TYPE were unset.
25 # test-util.lisp performs the setenv.
28 case "$SBCL_MACHINE_TYPE" in
30 cat > $tmpscript <<EOF
31 (let ((x (make-array (min (1- array-total-size-limit) (1- (expt 2 32)))
32 :element-type '(unsigned-byte 8))))
33 (assert (> (sb-kernel:dynamic-usage) (length x)))
34 ;; prevent compiler from getting too smart...
36 (sb-ext:exit :code $EXIT_LISP_WIN))
38 run_sbcl_with_args
--dynamic-space-size 5GB
$SBCL_ARGS \
39 --eval "(setf sb-ext:*evaluator-mode* :${TEST_SBCL_EVALUATOR_MODE:-compile})" \
41 check_status_maybe_lose
"bug 881445" $?
45 run_sbcl
--eval '(sb-ext:exit)'
46 check_status_maybe_lose
"simple exit" $?
0 "ok"
48 run_sbcl
--eval '(sb-ext:exit :code 42)'
49 check_status_maybe_lose
"exit with code" $?
42 "ok"
51 run_sbcl
--eval '(progn (defvar *exit-code* 100) (push (lambda () (exit :code (decf *exit-code*))) *exit-hooks*) #+sb-thread (sb-thread:make-thread (lambda () (exit :code 13))) #-sb-thread (exit :code 13))'
52 check_status_maybe_lose
"exit with code" $?
99 "ok"
54 run_sbcl
--eval '(unwind-protect (sb-ext:exit :code 13 :abort t) (sb-ext:exit :code 7 :abort t))'
55 check_status_maybe_lose
"exit with abort" $?
13 "ok"
57 run_sbcl
--eval '(unwind-protect (sb-ext:exit :code 0 :abort t) (sb-ext:exit :code 7 :abort t))'
58 check_status_maybe_lose
"exit with abort and code 0" $?
0 "ok"
60 run_sbcl
--eval '(unwind-protect (sb-ext:exit :code 0 :abort nil) (sb-ext:exit :code 7))'
61 check_status_maybe_lose
"exit with abort and code 0" $?
7 "ok"