0.9.15.36: less intrusive step instrumentation
[sbcl.git] / tests / expect.sh
index 9a209fa..49e8489 100644 (file)
@@ -7,40 +7,36 @@ expect_load_error ()
 {
     # Test compiling and loading.
     $SBCL <<EOF
-       (compile-file "$1")
-       ;;; But loading the file should fail.
-       (multiple-value-bind (value0 value1) (ignore-errors (load *))
-           (assert (null value0))
-           (format t "VALUE1=~S (~A)~%" value1 value1)
-           (assert (typep value1 'error)))
-       (sb-ext:quit :unix-status 52)
+        (compile-file "$1")
+        ;;; But loading the file should fail.
+        (multiple-value-bind (value0 value1) (ignore-errors (load *))
+            (assert (null value0))
+            (format t "VALUE1=~S (~A)~%" value1 value1)
+            (assert (typep value1 'error)))
+        (sb-ext:quit :unix-status 52)
 EOF
     if [ $? != 52 ]; then
-       echo compile-and-load $1 test failed: $?
-       exit 1
+        echo compile-and-load $1 test failed: $?
+        exit 1
     fi
 
     # Test loading into the interpreter.
     $SBCL <<EOF
-       (multiple-value-bind (value0 value1) (ignore-errors (load "$1"))
-           (assert (null value0))
-           (format t "VALUE1=~S (~A)~%" value1 value1)
-           (assert (typep value1 'error)))
-       (sb-ext:quit :unix-status 52)
+        (multiple-value-bind (value0 value1) (ignore-errors (load "$1"))
+            (assert (null value0))
+            (format t "VALUE1=~S (~A)~%" value1 value1)
+            (assert (typep value1 'error)))
+        (sb-ext:quit :unix-status 52)
 EOF
     if [ $? != 52 ]; then
-       echo load-into-interpreter $1 test failed: $?
-       exit 1
+        echo load-into-interpreter $1 test failed: $?
+        exit 1
     fi
 }
 
 # Test that a file compiles cleanly, with no ERRORs, WARNINGs or
 # STYLE-WARNINGs.
-#
-# Maybe this wants to be in a compiler.test.sh script?  This function
-# was originally written to test APD's patch for slot readers and
-# writers not being known to the compiler. -- CSR, 2002-08-14
-expect_clean_compile () 
+expect_clean_compile ()
 {
     $SBCL <<EOF
         (multiple-value-bind (pathname warnings-p failure-p)
@@ -94,9 +90,22 @@ fail_on_compiler_note ()
           (compile-file "$1")
           (sb-ext:quit :unix-status 52))
 EOF
-    if [ $? != 52]; then
-        echo compiler-note $1 test failed: $?
+    if [ $? != 52 ]; then
+        echo fail-on-compiler-note $1 test failed: $?
         exit 1
     fi
 }
 
+expect_compiler_note ()
+{
+    $SBCL <<EOF
+        (handler-bind ((sb-ext:compiler-note (lambda (c)
+                                               (declare (ignore c))
+                                               (sb-ext:quit :unix-status 52))))
+          (compile-file "$1"))
+EOF
+    if [ $? != 52 ]; then
+        echo expect-compiler-note $1 test failed: $?
+        exit 1
+    fi
+}