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 $?
33 # Test that a file compiles cleanly, with no ERRORs, WARNINGs or
35 expect_clean_compile ()
38 (multiple-value-bind (pathname warnings-p failure-p)
40 (declare (ignore pathname))
41 (assert (not warnings-p))
42 (assert (not failure-p))
43 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
45 check_status_maybe_lose clean-compile $?
48 expect_warned_compile ()
51 (multiple-value-bind (pathname warnings-p failure-p)
53 (declare (ignore pathname))
55 (assert (not failure-p))
56 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
58 check_status_maybe_lose warn-compile $?
61 expect_failed_compile ()
64 (multiple-value-bind (pathname warnings-p failure-p)
66 (declare (ignore pathname warnings-p))
68 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
70 check_status_maybe_lose fail-compile $?
73 expect_aborted_compile ()
77 (fasl (compile-file-pathname lisp)))
78 (multiple-value-bind (pathname warnings-p failure-p)
79 (compile-file "$1" :print t)
80 (assert (not pathname))
83 (assert (not (probe-file fasl))))
84 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
86 check_status_maybe_lose abort-compile $?
89 fail_on_compiler_note ()
92 (handler-bind ((sb-ext:compiler-note #'error))
94 (sb-ext:quit :unix-status $EXIT_LISP_WIN))
96 check_status_maybe_lose fail-on-compiler-note $?
99 expect_compiler_note ()
102 (handler-bind ((sb-ext:compiler-note (lambda (c)
104 (sb-ext:quit :unix-status
108 check_status_maybe_lose expect-compiler-note $?