diff --git a/test/test-asdf.asd b/test/test-asdf.asd index 3f1ed8402564466e42152dfb3af779dd3d3a5e31..ef2ff4aa5f5a2c44896ea698ed5ceb9c62f31fd5 100644 --- a/test/test-asdf.asd +++ b/test/test-asdf.asd @@ -83,3 +83,19 @@ ;; so that we can check that forcing causes one file to be reloaded but not the other. :depends-on (:file3-only) :components ((:file "file1"))) + +;; These are used by test-defsystem-depends-on-change.asd, test-defsystem-depends-on-change.script +(defvar *ta/dcc* 0) +(defsystem "test-asdf/dep-can-change" + :depends-on ("test-asdf-location-change") + :perform (load-op (o c) (incf *ta/dcc*))) + +(defvar *ta/dcd* 0) +(defsystem "test-asdf/dep-can-disappear" + :depends-on ("test-asdf-location-change") + :perform (load-op (o c) (incf *ta/dcd*))) + +(defvar *ta/dca* 0) +(defsystem "test-asdf/dep-can-appear" + :depends-on ("test-asdf-location-change") + :perform (load-op (o c) (incf *ta/dca*))) diff --git a/test/test-defsystem-depends-on-change.asd b/test/test-defsystem-depends-on-change.asd new file mode 100644 index 0000000000000000000000000000000000000000..3c17719c047b89e917d4108e2d66f6a988928247 --- /dev/null +++ b/test/test-defsystem-depends-on-change.asd @@ -0,0 +1,8 @@ +(defvar *tddoc* 0) +(incf *tddoc*) + +(if (= *tddoc* 1) + (defsystem "test-defsystem-depends-on-change" + :defsystem-depends-on ("test-asdf/dep-can-change" "test-asdf/dep-can-disappear")) + (defsystem "test-defsystem-depends-on-change" + :defsystem-depends-on ("test-asdf/dep-can-change" "test-asdf/dep-can-appear"))) diff --git a/test/test-defsystem-depends-on-change.script b/test/test-defsystem-depends-on-change.script new file mode 100644 index 0000000000000000000000000000000000000000..1cd72686dc93d6abfb101fcb39430a4160034630 --- /dev/null +++ b/test/test-defsystem-depends-on-change.script @@ -0,0 +1,55 @@ +;;; -*- Lisp -*- +;; Testing proper stratification of defsystem-depends-on changes. + +(DBG "Test that when a defsystem-depends-on (indirect) dependency changes, the system is recompiled, yet that dependencies of the old definition that are not dependencies of the new definition are not recompiled.") + +;; disable cache between those compilations. +(setf asdf/session:*asdf-session* nil) + +(defparameter tddoc "test-defsystem-depends-on-change") +(defparameter talc "test-asdf-location-change") + + +(DBG "Load the system, using xach-foo-1") +(push (subpathname *test-directory* "xach-foo-1/") *central-registry*) +(load-system tddoc) +(assert-equal asdf-user::*tddoc* 1) +(assert-equal test-asdf-system::*times-loaded* 1) +(assert-equal test-asdf-system::*ta/dcc* 1) +(assert-equal test-asdf-system::*ta/dcd* 1) +(assert-equal test-asdf-system::*ta/dca* 0) +(assert-pathname-equal + (subpathname *test-directory* "test-defsystem-depends-on-change.asd") + (system-source-file tddoc)) +(assert-pathname-equal + (subpathname *test-directory* "xach-foo-1/test-asdf-location-change.asd") + (system-source-file talc)) + +(DBG "Load it again: there should be no changes") +(load-system "test-defsystem-depends-on-change") +(assert-equal asdf-user::*tddoc* 1) +(assert-equal test-asdf-system::*times-loaded* 1) +(assert-equal test-asdf-system::*ta/dcc* 1) +(assert-equal test-asdf-system::*ta/dcd* 1) +(assert-equal test-asdf-system::*ta/dca* 0) +(assert-pathname-equal + (subpathname *test-directory* "test-defsystem-depends-on-change.asd") + (system-source-file tddoc)) +(assert-pathname-equal + (subpathname *test-directory* "xach-foo-1/test-asdf-location-change.asd") + (system-source-file talc)) + +(DBG "Now, change a defsystem-depends-on dependency and try again") +(setf (first *central-registry*) (subpathname *test-directory* "xach-foo-2/")) +(load-system "test-defsystem-depends-on-change") +(assert-equal asdf-user::*tddoc* 2) +(assert-equal test-asdf-system::*times-loaded* 1) ;; from test-asdf.asd +(assert-equal test-asdf-system::*ta/dcc* 2) +(assert-equal test-asdf-system::*ta/dcd* 1) +(assert-equal test-asdf-system::*ta/dca* 1) +(assert-pathname-equal + (subpathname *test-directory* "test-defsystem-depends-on-change.asd") + (system-source-file tddoc)) +(assert-pathname-equal + (subpathname *test-directory* "xach-foo-2/test-asdf-location-change.asd") + (system-source-file talc)) diff --git a/test/test-xach-update-bug.script b/test/test-xach-update-bug.script index c0ddfa6ec586530ef625ace8ae3e7dd4846c8747..bb047d4be45ff1f5b4432085bfd76cf1707b9dff 100644 --- a/test/test-xach-update-bug.script +++ b/test/test-xach-update-bug.script @@ -1,8 +1,6 @@ ;;; -*- Lisp -*- (setf asdf/session:*asdf-session* nil) ;; disable cache between those two very different compilations. -#-(and ecl ecl-bytecmp) -(setf asdf::*load-system-operation* 'load-bundle-op) ;; This triggers a bug on ECL no more! (defparameter foo :test-asdf-location-change)