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
40 # Maybe this wants to be in a compiler.test.sh script? This function
41 # was originally written to test APD's patch for slot readers and
42 # writers not being known to the compiler. -- CSR, 2002-08-14
43 expect_clean_compile ()
46 (multiple-value-bind (pathname warnings-p failure-p)
48 (declare (ignore pathname))
49 (assert (not warnings-p))
50 (assert (not failure-p))
51 (sb-ext:quit :unix-status 52))
54 echo clean-compile $1 test failed: $?
59 expect_warned_compile ()
62 (multiple-value-bind (pathname warnings-p failure-p)
64 (declare (ignore pathname))
66 (assert (not failure-p))
67 (sb-ext:quit :unix-status 52))
70 echo warn-compile $1 test failed: $?
75 expect_failed_compile ()
78 (multiple-value-bind (pathname warnings-p failure-p)
80 (declare (ignore pathname warnings-p))
82 (sb-ext:quit :unix-status 52))
85 echo fail-compile $1 test failed: $?
90 fail_on_compiler_note ()
93 (handler-bind ((sb-ext:compiler-note #'error))
95 (sb-ext:quit :unix-status 52))
98 echo compiler-note $1 test failed: $?