test-defsystem-depends-on-phase-overlap.script 1.62 KB
Newer Older
1 2
;;-*- Lisp -*-

3 4
;; TODO: make it files, so that DEFINE-OP can propagate and cause reloading.

5 6
(in-package :asdf-test)

7
(setf *central-registry* (list (subpathname *test-directory* "defsystem-depends-on/")))
8

9 10 11 12 13 14 15
(defvar *od* 0)
(defvar *dd* 0)
(defvar *id* 0)
(defvar *ms* 0)
(defun reset-vars (&optional (x 0))
  (setf *od* x *dd* x *id* x *ms* x))
(assert-equal (list *od* *dd* *id* *ms*) '(0 0 0 0))
16

17 18 19 20
(DBG "Finding main-system doesn't load defsystem-dependency")
(reset-vars)
(find-system "main-system")
(assert-equal (list *od* *dd* *id* *ms*) '(0 0 0 0))
21

22 23 24 25
(DBG "Finding intermediate-dependency does load defsystem-dependency")
(reset-vars)
(find-system "intermediate-dependency")
(assert-equal (list *od* *dd* *id* *ms*) '(1 1 0 0))
26

27 28 29 30
(DBG "Loading main-system doesn't reload defsystem-dependency or overlapping-dependency")
(reset-vars)
(load-system "main-system")
(assert-equal (list *od* *dd* *id* *ms*) '(0 0 1 1))
31

32 33
(DBG "Loading main-system a second time doesn't reload anything")
(reset-vars)
34
(load-system "main-system")
35 36 37 38 39 40 41 42 43 44 45 46
(assert-equal (list *od* *dd* *id* *ms*) '(0 0 0 0))

(DBG :foo
     (component-sideway-dependencies (find-system "intermediate-dependency"))
     (asdf::direct-dependencies 'prepare-op "intermediate-dependency")
     (asdf::direct-dependencies 'load-op "intermediate-dependency")
     (asdf::direct-dependencies 'compile-op "intermediate-dependency"))

(DBG "Forcing overlapping-dependency causes a complete reload, but overlapping-dependency is only loaded once")
(reset-vars)
(with-asdf-session (:override t)
  (load-system "main-system" :force '("overlapping-dependency")))
47
(assert-equal (list *od* *dd* *id* *ms*) '(1 1 1 1))