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 fail_on_compiler_note ()
89 (handler-bind ((sb-ext:compiler-note #'error))
91 (sb-ext:quit :unix-status 52))
94 echo fail-on-compiler-note $1 test failed: $?
99 expect_compiler_note ()
102 (handler-bind ((sb-ext:compiler-note (lambda (c)
104 (sb-ext:quit :unix-status 52))))
107 if [ $? != 52 ]; then
108 echo expect-compiler-note $1 test failed: $?