-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathtest-defsystem-depends-on-phase-overlap.script
66 lines (54 loc) · 2.36 KB
/
test-defsystem-depends-on-phase-overlap.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
;;-*- Lisp -*-
(in-package :asdf-test)
(setf *central-registry* (list (subpathname *test-directory* "defsystem-depends-on/")))
(defvar *od* 0)
(defvar *dd* 0)
(defvar *id* 0)
(defvar *ms* 0)
(defvar *cod* 0)
(defvar *cdd* 0)
(defun reset-vars (&optional (x 0))
(setf *od* x *dd* x *id* x *ms* x *cod* x *cdd* x))
(assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(0 0 0 0 0 0))
(DBG "Finding main-system doesn't load defsystem-dependency")
(reset-vars)
(find-system "main-system")
(assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(0 0 0 0 0 0))
(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))
(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* *cod* *cdd*) '(0 0 1 1 0 0))
(DBG "Loading main-system a second time doesn't reload anything")
(reset-vars)
(load-system "main-system")
(assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(0 0 0 0 0 0))
(DBG "Loading main-system in a different session loads but doesn't recompile")
(reset-vars)
(asdf::clear-registered-systems)
(load-system "main-system")
(assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(1 1 1 1 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")))
(assert-equal (list *od* *dd* *id* *ms*) '(1 1 1 1))
(DBG "actions marked as needed at one level should still be planned if needed at a higher level")
(reset-vars)
(setf (find-class 'asdf::my-cl-source-file) nil)
(asdf::clear-registered-systems)
(assert-equal *dd* 0)
(with-asdf-session (:override t)
;; get this (and asdf) out of the way, for simpler traces when tracing what matters.
(load-system "overlapping-dependency")
;; This is what causes an issue without phase escalation:
(test-system "defsystem-dependency"))
(assert-equal *dd* 10)