3 # This software is part of the SBCL system. See the README file for
6 # While most of SBCL is derived from the CMU CL system, the test
7 # files (like this one) were written from scratch after the fork
10 # This software is in the public domain and is provided with
11 # absolutely no warranty. See the COPYING and CREDITS files for
16 # LOADing and COMPILEing files with logical pathnames
17 testdir
=`pwd`"/side-effectful-pathnames-test-$$"
18 testfilestem
="load-test"
19 StudlyCapsStem
="Load-Test"
20 testfilename
="$testdir/$testfilestem.lisp"
22 cat >$testfilename <<EOF
24 (defparameter *loaded* :yes)
28 (setf (logical-pathname-translations "TEST")
29 (list (list "**;*.*.*" "$testdir/**/*.*")))
30 (format t "/translations=~S~%" (logical-pathname-translations "TEST"))
31 (let* ((untranslated "test:$StudlyCapsStem.lisp")
32 (ignore-me (format t "untranslated=~S~%" untranslated))
33 (translation (namestring (translate-logical-pathname untranslated)))
34 (expected-translation "$testdir/$testfilestem.lisp"))
35 (format t "translation=~S~%" translation)
36 (format t "expected-translation=~S~%" expected-translation)
37 (assert (string= translation expected-translation)))
38 (format t "about to LOAD ~S~%" "TEST:$StudlyCapsStem")
39 (load "TEST:$StudlyCapsStem")
40 (assert (eq *loaded* :yes))
41 (let ((compiled-file-name (namestring (compile-file "TEST:$StudlyCapsStem")))
42 (expected-file-name "$testdir/$testfilestem.fasl"))
43 (format t "compiled-file-name=~S~%" compiled-file-name)
44 (format t "expected-file-name=~S~%" expected-file-name)
45 (assert (string= compiled-file-name expected-file-name)))
46 (sb-ext:quit :unix-status 52)
49 echo LOAD
/COMPILE
test failed
, unexpected Lisp
return code
=$?
52 # We don't need the test directory any more.
55 # In the flaky1 branch, Dan Barlow pointed out that
56 # ENSURE-DIRECTORIES-EXIST failed for these relative pathname
57 # operations when the mysterious special case handling of "" pathnames
58 # was removed from UNIX-STAT. Let's make sure that it works now.
60 # Set up an empty directory to work with.
61 testdir
=${TMPDIR:-/tmp}/sbcl-mkdir-test-$$
62 if ! rm -rf $testdir ; then
63 echo "$testdir already exists and could not be deleted"
71 (let ((rel-name #p"foo/bar/")
72 (abs-name (merge-pathnames #p"baz/quux/" (truename "."))))
74 (ensure-directories-exist abs-name)
75 (ensure-directories-exist rel-name)
76 (sb-ext:quit :unix-status 52)))
79 echo ENSURE-DIRECTORIES-EXIST
test failed
, unexpected SBCL
return code
=$?
83 if [ ! -d $testdir/foo
/bar
] ; then
84 echo test failed
: $testdir/foo
/bar is not a directory
88 if [ ! -d $testdir/baz
/quux
] ; then
89 echo test failed
: $testdir/baz
/quux is not a directory
94 # We succeeded, life is good. Now we don't need the test directory
95 # any more; and come back home.
99 # success convention for script