0.9.16.17:
[sbcl.git] / tests / side-effectful-pathnames.test.sh
index f81b15a..b2236e6 100644 (file)
@@ -6,7 +6,7 @@
 # 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.
@@ -35,10 +35,11 @@ $SBCL <<EOF
     (format t "translation=~S~%" translation)
     (format t "expected-translation=~S~%" expected-translation)
     (assert (string= translation expected-translation)))
+  (format t "about to LOAD ~S~%" "TEST:$StudlyCapsStem")
   (load "TEST:$StudlyCapsStem")
   (assert (eq *loaded* :yes))
   (let ((compiled-file-name (namestring (compile-file "TEST:$StudlyCapsStem")))
-        (expected-file-name "$testdir/$testfilestem.x86f"))
+        (expected-file-name "$testdir/$testfilestem.fasl"))
     (format t "compiled-file-name=~S~%" compiled-file-name)
     (format t "expected-file-name=~S~%" expected-file-name)
     (assert (string= compiled-file-name expected-file-name)))
@@ -57,42 +58,42 @@ rm -r $testdir
 # was removed from UNIX-STAT. Let's make sure that it works now.
 #
 # Set up an empty directory to work with.
-testfilestem=$TMPDIR/sbcl-mkdir-test-$$
-if ! rm -rf $testfilestem ; then
-  echo "$testfilestem already exists and cannot be deleted"
+testdir=${TMPDIR:-/tmp}/sbcl-mkdir-test-$$
+if ! rm -rf $testdir ; then
+  echo "$testdir already exists and could not be deleted"
   exit 1;
 fi
-mkdir $testfilestem
-cd  $testfilestem
+mkdir $testdir
+cd $testdir
 #
 # Provoke failure.
 $SBCL <<EOF
 (let ((rel-name #p"foo/bar/")
       (abs-name (merge-pathnames #p"baz/quux/" (truename "."))))
   (and
-   (ensure-directories-exist abs-name)
-   (ensure-directories-exist rel-name)
+   (equalp (ensure-directories-exist abs-name) abs-name)
+   (equalp (ensure-directories-exist rel-name) rel-name)
    (sb-ext:quit :unix-status 52)))
 EOF
 if [ $? != 52 ]; then
     echo ENSURE-DIRECTORIES-EXIST test failed, unexpected SBCL return code=$?
-    find $testfilestem -print
+    find $testdir -print
     exit 1
 fi
-if [ ! -d $testfilestem/foo/bar ] ; then
-    echo test failed: $testfilestem/foo/bar is not a directory
-    find $testfilestem -print
+if [ ! -d $testdir/foo/bar ] ; then
+    echo test failed: $testdir/foo/bar is not a directory
+    find $testdir -print
     exit 1
 fi;
-if [ ! -d $testfilestem/baz/quux ] ; then
-    echo test failed: $testfilestem/baz/quux is not a directory
-    find $testfilestem -print
+if [ ! -d $testdir/baz/quux ] ; then
+    echo test failed: $testdir/baz/quux is not a directory
+    find $testdir -print
     exit 1
 fi;
 #
 # We succeeded, life is good. Now we don't need the test directory
 # any more; and come back home.
-rm -r $testfilestem
+rm -r $testdir
 cd $original_pwd
 
 # success convention for script