Commit 74c2f241 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Reindent test-xach-update-bug.script

parent f6ff069c
...@@ -6,51 +6,51 @@ ...@@ -6,51 +6,51 @@
(defparameter foo :test-asdf-location-change) (defparameter foo :test-asdf-location-change)
(with-expected-failure (#+ecl (not (asdf:version-satisfies (lisp-implementation-version) "16")) #+ecl (unless (version-satisfies (lisp-implementation-version) "16")
#-ecl nil) (leave-test "ECL only supports this test starting with 16.0.0" 0))
(DBG "load foo. Should load from xach-foo-1/")
(setf *central-registry* (list (subpathname *test-directory* "xach-foo-1/")))
(defparameter foo1 (find-system foo))
(assert-pathname-equal
(subpathname *test-directory* "xach-foo-1/test-asdf-location-change.asd")
(system-source-file foo1))
(assert-equal (mapcar 'component-name (component-children foo1)) '("a"))
(assert-pathname-equal
(subpathname *test-directory* "xach-foo-1/a.lisp")
(component-pathname (find-component foo1 "a")))
(assert-equal nil (find-component foo1 "b"))
(load-system foo)
(defparameter loaded (find-symbol* :loaded :first-version))
(assert-equal (symbol-value loaded) t)
(DBG "load foo again. Should not do anything -- already loaded") (DBG "load foo. Should load from xach-foo-1/")
(setf (symbol-value loaded) :test-that-we-dont-reload) (setf *central-registry* (list (subpathname *test-directory* "xach-foo-1/")))
(load-system foo) (defparameter foo1 (find-system foo))
(assert-equal (symbol-value loaded) :test-that-we-dont-reload) (assert-pathname-equal
(assert (not (find-package :second-version))) (subpathname *test-directory* "xach-foo-1/test-asdf-location-change.asd")
(system-source-file foo1))
(assert-equal (mapcar 'component-name (component-children foo1)) '("a"))
(assert-pathname-equal
(subpathname *test-directory* "xach-foo-1/a.lisp")
(component-pathname (find-component foo1 "a")))
(assert-equal nil (find-component foo1 "b"))
(load-system foo)
(defparameter loaded (find-symbol* :loaded :first-version))
(assert-equal (symbol-value loaded) t)
(DBG "Now, change registry so foo is found from xach-foo-2/") (DBG "load foo again. Should not do anything -- already loaded")
(setf *central-registry* (list (subpathname *test-directory* "xach-foo-2/"))) (setf (symbol-value loaded) :test-that-we-dont-reload)
(defparameter foo2 (find-system foo)) (load-system foo)
(assert (eq foo1 foo2)) ;; the object should be the same (assert-equal (symbol-value loaded) :test-that-we-dont-reload)
(assert-equal (mapcar 'component-name (component-children foo2)) '("a" "b")) (assert (not (find-package :second-version)))
(assert-pathname-equal
(subpathname *test-directory* "xach-foo-2/test-asdf-location-change.asd") (DBG "Now, change registry so foo is found from xach-foo-2/")
(system-source-file foo2)) (setf *central-registry* (list (subpathname *test-directory* "xach-foo-2/")))
(assert-pathname-equal (defparameter foo2 (find-system foo))
(subpathname *test-directory* "xach-foo-2/a.lisp") (assert (eq foo1 foo2)) ;; the object should be the same
(component-pathname (find-component foo2 "a"))) (assert-equal (mapcar 'component-name (component-children foo2)) '("a" "b"))
(assert-pathname-equal (assert-pathname-equal
(subpathname *test-directory* "xach-foo-2/b.lisp") (subpathname *test-directory* "xach-foo-2/test-asdf-location-change.asd")
(component-pathname (find-component foo2 "b"))) (system-source-file foo2))
(DBG "load foo yet again. It should see the pathname has changed and load it anew") (assert-pathname-equal
;;; ECL bug: this fails if we use load-bundle-op instead of load-op as *load-system-operation* (subpathname *test-directory* "xach-foo-2/a.lisp")
;;; in bundle.lisp. The test-asdf-location-change.fasb is linked and loaded, but that fails to (component-pathname (find-component foo2 "a")))
;;; create the :second-version package; loading the same .fasb in another ecl works fine, and (assert-pathname-equal
;;; defines (second-version:wtf). WTF? You can test this bug by uncommenting the (subpathname *test-directory* "xach-foo-2/b.lisp")
;;; (setf asdf::*load-system-operation* 'load-bundle-op) line at the beginning of this file. (component-pathname (find-component foo2 "b")))
;;; NB: works on MKCL. (DBG "load foo yet again. It should see the pathname has changed and load it anew")
(load-system foo) ;;; ECL bug: this fails if we use load-bundle-op instead of load-op as *load-system-operation*
(assert (symbol-value (find-symbol* :loaded :second-version))) ;;; in bundle.lisp. The test-asdf-location-change.fasb is linked and loaded, but that fails to
(assert-equal 42 (symbol-call :second-version :wtf)) ;;; create the :second-version package; loading the same .fasb in another ecl works fine, and
) ;;; defines (second-version:wtf). WTF? You can test this bug by uncommenting the
;;; (setf asdf::*load-system-operation* 'load-bundle-op) line at the beginning of this file.
;;; NB: works on MKCL.
(load-system foo)
(assert (symbol-value (find-symbol* :loaded :second-version)))
(assert-equal 42 (symbol-call :second-version :wtf))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment