Fix make-array transforms.
[sbcl.git] / tests / clos.test.sh
index 65dd5d8..9f8d4e1 100644 (file)
@@ -6,70 +6,16 @@
 # While most of SBCL is derived from the CMU CL system, the test
 # files (like this one) were written from scratch after the fork
 # from CMU CL.
-# 
+#
 # This software is in the public domain and is provided with
 # absolutely no warranty. See the COPYING and CREDITS files for
 # more information.
 
-# Check that compiling and loading the file $1 generates an error
-# at load time; also that just loading it directly (into the
-# interpreter) generates an error.
-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)
-EOF
-    if [ $? != 52 ]; then
-       echo compile-and-load $1 test failed: $?
-       exit 1
-    fi
+. ./expect.sh
 
-    # 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)
-EOF
-    if [ $? != 52 ]; then
-       echo load-into-interpreter $1 test failed: $?
-       exit 1
-    fi
-}
+use_test_subdirectory
 
-# 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 () 
-{
-    $SBCL <<EOF
-        (multiple-value-bind (pathname warnings-p failure-p)
-            (compile-file "$1")
-          (declare (ignore pathname))
-          (assert (not warnings-p))
-          (assert (not failure-p))
-          (sb-ext:quit :unix-status 52))
-EOF
-    if [ $? != 52 ]; then
-        echo clean-compile $1 test failed: $?
-        exit 1
-    fi
-}
-
-base_tmpfilename="clos-test-$$-tmp"
-tmpfilename="$base_tmpfilename.lisp"
-compiled_tmpfilename="$base_tmpfilename.fasl"
+tmpfilename="$TEST_FILESTEM.lisp"
 
 # This should fail, but didn't until sbcl-0.6.12.7, with Martin
 # Atzmueller's port of Pierre Mai's fixes.
@@ -78,6 +24,7 @@ cat > $tmpfilename <<EOF
     ;; This definition has too many qualifiers, so loading the
     ;; DEFMETHOD should fail.
     (defmethod zut progn :around ((x integer)) (print "integer"))
+    (zut 1)
 EOF
 expect_load_error $tmpfilename
 
@@ -89,6 +36,7 @@ cat > $tmpfilename <<EOF
     ;; This definition is missing the PROGN qualifier, and so the
     ;; DEFMETHOD should fail.
     (defmethod zut ((x integer)) (print "integer"))
+    (zut 1)
 EOF
 expect_load_error $tmpfilename
 
@@ -103,6 +51,7 @@ cat > $tmpfilename <<EOF
     ;; This definition has too many qualifiers, so loading the
     ;; DEFMETHOD should fail.
     (defmethod zut progn :around ((x integer)) (print "integer"))
+    (zut 1)
 EOF
 expect_load_error $tmpfilename
 
@@ -112,7 +61,7 @@ expect_load_error $tmpfilename
 # succession.
 cat > $tmpfilename <<EOF
     (in-package :cl-user)
-    (defclass another-class-with-slots () 
+    (defclass another-class-with-slots ()
       (a-new-slot-name))
     (defun foo (x)
       (values (setf (slot-value x 'a-new-slot-name) 2)
@@ -120,8 +69,5 @@ cat > $tmpfilename <<EOF
 EOF
 expect_clean_compile $tmpfilename
 
-rm $tmpfilename
-rm $compiled_tmpfilename
-
-# success 
-exit 104
+# success
+exit $EXIT_TEST_WIN