0.6.12.7:
[sbcl.git] / tests / side-effectful-pathnames.test.sh
1 #!/bin/sh
2
3 # This software is part of the SBCL system. See the README file for
4 # more information.
5 #
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
8 # from CMU CL.
9
10 # This software is in the public domain and is provided with
11 # absolutely no warranty. See the COPYING and CREDITS files for
12 # more information.
13
14 # LOADing and COMPILEing files with logical pathnames
15 testdir=`pwd`"/side-effectful-pathnames-test-$$"
16 testfilestem="load-test"
17 StudlyCapsStem="Load-Test"
18 testfilename="$testdir/$testfilestem.lisp"
19 mkdir $testdir
20 cat >$testfilename <<EOF
21   (in-package :cl-user)
22   (defparameter *loaded* :yes)
23 EOF
24 $SBCL <<EOF
25   (in-package :cl-user)
26   (setf (logical-pathname-translations "TEST")
27         (list (list "**;*.*.*" "$testdir/**/*.*")))
28   (format t "/translations=~S~%" (logical-pathname-translations "TEST"))
29   (let* ((untranslated "test:$StudlyCapsStem.lisp")
30          (ignore-me (format t "untranslated=~S~%" untranslated))
31          (translation (namestring (translate-logical-pathname untranslated)))
32          (expected-translation "$testdir/$testfilestem.lisp"))
33     (format t "translation=~S~%" translation)
34     (format t "expected-translation=~S~%" expected-translation)
35     (assert (string= translation expected-translation)))
36   (load "TEST:$StudlyCapsStem")
37   (assert (eq *loaded* :yes))
38   (let ((compiled-file-name (namestring (compile-file "TEST:$StudlyCapsStem")))
39         (expected-file-name "$testdir/$testfilestem.x86f"))
40     (format t "compiled-file-name=~S~%" compiled-file-name)
41     (format t "expected-file-name=~S~%" expected-file-name)
42     (assert (string= compiled-file-name expected-file-name)))
43   (sb-ext:quit :unix-status 52)
44 EOF
45 if [ $? != 52 ]; then
46     echo test failed: $?
47     exit 1
48 fi
49 rm -r $testdir
50
51 # success
52 exit 104