Commit 37801377 authored by Robert Goldman's avatar Robert Goldman
Browse files

Add test for :if-feature propagation.

The concern here is that ASDF has no way to detect that a feature has
changed and recompile files accordingly, potentially leaving users
with stale FASL files.
parent 8ac5bd42
Pipeline #6286 failed with stage
(defpackage :test-package-2 (:use cl))
(in-package :test-package-2)
(defmacro package-dependent-code ()
(if (find-package :test-package)
(import (intern (symbol-name '#:*file1*) :test-package)
(assert (asdf-test:asymval '#:*file1* :test-package-2)))
'(assert (not (uiop:find-symbol* '#:*file1* :test-package-2
......@@ -12,3 +12,26 @@
(asdf:operate 'asdf:load-op
(asdf:find-component (asdf:find-system "test-serial-dependencies")
(list "file2")))
(def-test-system "test-feature-tracking"
:serial t
((:file "file1" :if-feature :changing-feature)
(:file "test-package-exists")))
(asdf:load-system "test-feature-tracking")
;; attempt to restore to original state
(delete-package :test-package-2)
(push :changing-feature *features*)
(asdf:load-system "test-feature-tracking" :force t)
;;; if ASDF is not smart about features, then this test will fail
;;; because ASDF will load only test-package-exists
(delete-package :test-package)
(delete-package :test-package-2)
(setf *features* (remove :changing-feature *features*))
(DBG "Here we should load only test-package-exists.")
;; if ASDF correctly recompiles test-package-exists, because it
;; detects that it needs recompilation because of the feature change,
;; this test will pass.
(asdf:load-system "test-feature-tracking")
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