;;; As reported by David Tolpin *LOAD-PATHNAME* was not merged.
(progn
- (defvar *saved-load-pathname*)
+ (defparameter *saved-load-pathname* nil)
(with-open-file (s *tmp-filename*
:direction :output
:if-exists :supersede
:if-does-not-exist :create)
(print '(setq *saved-load-pathname* *load-pathname*) s))
- (let (tmp-fasl)
- (unwind-protect
- (progn
- (load *tmp-filename*)
- (assert (equal (merge-pathnames *tmp-filename*) *saved-load-pathname*)))
- (delete-file *tmp-filename*))))
+ (unwind-protect
+ (progn
+ (load *tmp-filename*)
+ (assert (equal (merge-pathnames *tmp-filename*) *saved-load-pathname*)))
+ (delete-file *tmp-filename*)))
\f
;;; Test many, many variations on LOAD.
(defparameter *counter* 0)
:if-exists :append)
(write-line ";;comment"))
(handler-bind ((error (lambda (error)
- (declare (ignore error))
- (when (find-restart 'sb-fasl::source)
- (invoke-restart 'sb-fasl::source)))))
+ (declare (ignore error))
+ (when (find-restart 'sb-fasl::source)
+ (invoke-restart 'sb-fasl::source)))))
(load-and-assert spec source source))))
;; Ensure that we can invoke the restart OBJECT in the above case.
:if-exists :append)
(write-line ";;comment"))
(handler-bind ((error (lambda (error)
- (declare (ignore error))
- (when (find-restart 'sb-fasl::object)
- (invoke-restart 'sb-fasl::object)))))
+ (declare (ignore error))
+ (when (find-restart 'sb-fasl::object)
+ (invoke-restart 'sb-fasl::object)))))
(load-and-assert spec fasl fasl))))
(with-test (:name :bug-332 :fails-on :win32)
(flet ((stimulate-sbcl ()
- (let ((filename (format nil "/tmp/~A.lisp" (gensym))))
+ (let ((filename
+ (format nil "~A/~A.lisp"
+ (or (posix-getenv "TEST_DIRECTORY")
+ (posix-getenv "TMPDIR")
+ "/tmp")
+ (gensym))))
+ (ensure-directories-exist filename)
;; create a file which redefines a structure incompatibly
(with-open-file (f filename :direction :output :if-exists :supersede)
(print '(defstruct bug-332 foo) f)
#+#.(cl:if (cl:find-package "ASDF") '(or) '(and))
-(load (merge-pathnames "../contrib/asdf/asdf.fasl"))
+(require :asdf)
#+#.(cl:if (cl:find-package "SB-POSIX") '(or) '(and))
-(let ((asdf:*central-registry*
- (cons "../contrib/systems/" asdf:*central-registry*)))
- (handler-bind (#+win32 (warning #'muffle-warning))
- (asdf:oos 'asdf:load-op 'sb-posix)))
+(handler-bind (#+win32 (warning #'muffle-warning))
+ (require :sb-posix))
(load "test-util.lisp")
set -a # export all variables at assignment-time.
# Note: any script that uses the variables that name files should
# quote them (with double quotes), to contend with whitespace.
-SBCL_HOME="$SBCL_PWD/../contrib"
-SBCL_CORE="$SBCL_PWD/../output/sbcl.core"
-SBCL_RUNTIME="$SBCL_PWD/../src/runtime/sbcl"
-SBCL_ARGS="--noinform --no-sysinit --no-userinit --noprint --disable-debugger"
+SBCL_HOME="${TEST_SBCL_HOME:-$SBCL_PWD/../contrib}"
+SBCL_CORE="${TEST_SBCL_CORE:-$SBCL_PWD/../output/sbcl.core}"
+SBCL_RUNTIME="${TEST_SBCL_RUNTIME:-$SBCL_PWD/../src/runtime/sbcl}"
+SBCL_ARGS="${TEST_SBCL_ARGS:---noinform --no-sysinit --no-userinit --noprint --disable-debugger}"
# Scripts that use these variables should quote them.
TEST_BASENAME="`basename $0`"
-TEST_FILESTEM="`basename "${TEST_BASENAME}" | sed 's/\.sh$//'`"
-TEST_FILESTEM="`echo "${TEST_FILESTEM}" | sed 's/\./-/g'`"
-TEST_DIRECTORY="$SBCL_PWD/$TEST_FILESTEM-$$"
+TEST_FILESTEM="$(basename "${TEST_BASENAME}" | sed 's/\.sh$// ; s/\./-/g')"
+: ${TEST_BASEDIR:="$SBCL_PWD"}
+TEST_DIRECTORY="${TEST_BASEDIR}/${TEST_FILESTEM}-$$"
+export TEST_DIRECTORY
# "Ten four" is the closest numerical slang I can find to "OK", so
# it's the Unix status value that we expect from a successful test.