test-xach-update-bug.script 1.18 KB
Newer Older
1
;;; -*- Lisp -*-
2

3

4

5
#+gcl (trace load compile-file asdf:perform asdf::perform-plan)
6
(progn
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
  (let ((foo :test-asdf-location-change))
    (DBG "load foo. Should load from xach-foo-1/")
    (setf *central-registry* (list (subpathname *test-directory* "xach-foo-1/")))
    (load-system foo)
    (let ((foo1 (find-system foo))
          (loaded (find-symbol* :loaded :first-version)))
      (assert-equal (symbol-value loaded) t)
      (DBG "load foo again. Should not do anything -- already loaded")
      (setf (symbol-value loaded) :test-that-we-dont-reload)
      (load-system foo)
      (assert-equal (symbol-value loaded) :test-that-we-dont-reload)

      (assert (not (find-package :second-version)))
      (DBG "Now, change registry so foo is found from xach-foo-2/")
      (setf *central-registry* (list (subpathname *test-directory* "xach-foo-2/")))
      (DBG "load foo yet again. It should see the pathname has changed and load it anew")
      (load-system foo)
      (let ((foo2 (find-system foo)))
        (assert (eq foo1 foo2)) ;; the object should be the same
        (assert (symbol-value (find-symbol* :loaded :second-version)))
        (assert-equal 42 (symbol-call :second-version :wtf))))))