1 # file to be sourced by scripts wanting to test the compiler
3 # Check that compiling and loading the file $1 generates an error
4 # at load time; also that just loading it directly (into the
5 # interpreter) generates an error.
8 # Test compiling and loading.
11 ;;; But loading the file should fail.
12 (multiple-value-bind (value0 value1) (ignore-errors (load *))
13 (assert (null value0))
14 (format t "VALUE1=~S (~A)~%" value1 value1)
15 (assert (typep value1 'error)))
16 (sb-ext:quit :unix-status 52)
19 echo compile-and-load
$1 test failed
: $?
23 # Test loading into the interpreter.
25 (multiple-value-bind (value0 value1) (ignore-errors (load "$1"))
26 (assert (null value0))
27 (format t "VALUE1=~S (~A)~%" value1 value1)
28 (assert (typep value1 'error)))
29 (sb-ext:quit :unix-status 52)
32 echo load-into-interpreter
$1 test failed
: $?
37 # Test that a file compiles cleanly, with no ERRORs, WARNINGs or
39 expect_clean_compile
()
42 (multiple-value-bind (pathname warnings-p failure-p)
44 (declare (ignore pathname))
45 (assert (not warnings-p))
46 (assert (not failure-p))
47 (sb-ext:quit :unix-status 52))
50 echo clean-compile
$1 test failed
: $?
55 expect_warned_compile
()
58 (multiple-value-bind (pathname warnings-p failure-p)
60 (declare (ignore pathname))
62 (assert (not failure-p))
63 (sb-ext:quit :unix-status 52))
66 echo warn-compile
$1 test failed
: $?
71 expect_failed_compile
()
74 (multiple-value-bind (pathname warnings-p failure-p)
76 (declare (ignore pathname warnings-p))
78 (sb-ext:quit :unix-status 52))
81 echo fail-compile
$1 test failed
: $?
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 52))
100 echo abort-compile
$1 test failed
: $?
105 fail_on_compiler_note
()
108 (handler-bind ((sb-ext:compiler-note #'error))
110 (sb-ext:quit :unix-status 52))
112 if [ $?
!= 52 ]; then
113 echo fail-on-compiler-note
$1 test failed
: $?
118 expect_compiler_note
()
121 (handler-bind ((sb-ext:compiler-note (lambda (c)
123 (sb-ext:quit :unix-status 52))))
126 if [ $?
!= 52 ]; then
127 echo expect-compiler-note
$1 test failed
: $?