1 # file to be sourced by scripts wanting to test the compiler
5 # Check that compiling and loading the file $1 generates an error
6 # at load time; also that just loading it directly (into the
7 # interpreter) generates an error.
10 # Test compiling and loading.
13 ;;; But loading the file should fail.
14 (multiple-value-bind (value0 value1) (ignore-errors (load *))
15 (assert (null value0))
16 (format t "VALUE1=~S (~A)~%" value1 value1)
17 (assert (typep value1 'error)))
18 (sb-ext:quit :unix-status $EXIT_LISP_WIN)
20 check_status_maybe_lose compile-and-load $?
22 # Test loading into the interpreter.
24 (multiple-value-bind (value0 value1) (ignore-errors (load "$1"))
25 (assert (null value0))
26 (format t "VALUE1=~S (~A)~%" value1 value1)
27 (assert (typep value1 'error)))
28 (sb-ext:quit :unix-status $EXIT_LISP_WIN)
30 check_status_maybe_lose load-into-interpreter $?
35 expect_clean_compile $1
37 (multiple-value-bind (value0 value1)
38 (ignore-errors (load (compile-file-pathname "$1")))
40 (assert (null value1)))
41 (sb-ext:quit :unix-status $EXIT_LISP_WIN)
43 check_status_maybe_lose load-compiled $?
46 # Test that a file compiles cleanly, with no ERRORs, WARNINGs or
48 expect_clean_compile ()
51 (multiple-value-bind (pathname warnings-p failure-p)
53 (declare (ignore pathname))
54 (assert (not warnings-p))
55 (assert (not failure-p))
56 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
58 check_status_maybe_lose clean-compile $?
61 expect_warned_compile ()
64 (multiple-value-bind (pathname warnings-p failure-p)
66 (declare (ignore pathname))
68 (assert (not failure-p))
69 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
71 check_status_maybe_lose warn-compile $?
74 expect_failed_compile ()
77 (multiple-value-bind (pathname warnings-p failure-p)
79 (declare (ignore pathname warnings-p))
81 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
83 check_status_maybe_lose fail-compile $?
86 expect_aborted_compile ()
90 (fasl (compile-file-pathname lisp)))
91 (multiple-value-bind (pathname warnings-p failure-p)
92 (compile-file "$1" :print t)
93 (assert (not pathname))
96 (assert (not (probe-file fasl))))
97 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
99 check_status_maybe_lose abort-compile $?
102 fail_on_condition_during_compile ()
105 (handler-bind (($1 #'error))
107 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
109 check_status_maybe_lose "fail-on-condition_$1" $?
112 expect_condition_during_compile ()
115 (handler-bind (($1 (lambda (c)
117 (sb-ext:quit :unix-status $EXIT_LISP_WIN))))
120 check_status_maybe_lose "expect-condition_$1" $?