-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-defsystem-depends-on-change.script
62 lines (54 loc) · 2.7 KB
/
test-defsystem-depends-on-change.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
;;; -*- 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")
(defparameter asdf-user::*tddoc* 0)
(terpri)(terpri)
(DBG "Load the system, using xach-foo-1")
(push (subpathname *test-directory* "xach-foo-1/") *central-registry*)
(clear-system tddoc)
(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))
(terpri)(terpri)
(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/"))
(DBG :before asdf-user::*tddoc* test-asdf-system::*times-loaded* test-asdf-system::*ta/dcc* test-asdf-system::*ta/dcd* test-asdf-system::*ta/dca*)
(load-system "test-defsystem-depends-on-change" :force '("test-asdf/dep-forced"))
(DBG :after asdf-user::*tddoc* test-asdf-system::*times-loaded* test-asdf-system::*ta/dcc* test-asdf-system::*ta/dcd* test-asdf-system::*ta/dca*)
(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))