Commit 4f276300 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Split test-defsystem-depends-on-phase-overlap.script into files

parent 87788ed0
(defsystem "defsystem-dependency"
:depends-on ("overlapping-dependency")
:components ((:file "defsystem-dependency")))
(in-package :asdf-test)
(defvar *dd* 0)
(incf *dd*)
(defsystem "intermediate-dependency"
:defsystem-depends-on ("defsystem-dependency")
:components ((:file "intermediate-dependency")))
(in-package :asdf-test)
(defvar *id* 0)
(incf *id*)
(defsystem "main-system"
:depends-on ("overlapping-dependency" "intermediate-dependency")
:components ((:file "main-system")))
(in-package :asdf-test)
(defvar *ms* 0)
(incf *ms*)
(in-package :asdf-test)
(defvar *od* 0)
(defsystem "overlapping-dependency"
:components ((:file "overlapping-dependency"))
;;:perform (load-op (o c) (incf *od*))
(in-package :asdf-test)
(defvar *od* 0)
(incf *od*)
;;-*- Lisp -*- ;;-*- Lisp -*-
;; TODO: make it files, so that DEFINE-OP can propagate and cause reloading.
(in-package :asdf-test) (in-package :asdf-test)
(setf *central-registry* nil) (setf *central-registry* (list (subpathname *test-directory* "defsystem-depends-on/")))
(defparameter *od* 0) (defvar *od* 0)
(def-test-system "overlapping-dependency" (defvar *dd* 0)
:perform (load-op (o c) (incf *od*))) (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))
(defparameter *dd* 0) (DBG "Finding main-system doesn't load defsystem-dependency")
(def-test-system "defsystem-dependency" (reset-vars)
:depends-on ("overlapping-dependency") (find-system "main-system")
:perform (load-op (o c) (incf *dd*))) (assert-equal (list *od* *dd* *id* *ms*) '(0 0 0 0))
(defparameter *id* 0) (DBG "Finding intermediate-dependency does load defsystem-dependency")
(def-test-system "intermediate-dependency" (reset-vars)
:defsystem-depends-on ("defsystem-dependency") (find-system "intermediate-dependency")
:perform (load-op (o c) (incf *id*))) (assert-equal (list *od* *dd* *id* *ms*) '(1 1 0 0))
(defparameter *ms* 0) (DBG "Loading main-system doesn't reload defsystem-dependency or overlapping-dependency")
(def-test-system "main-system" (reset-vars)
:depends-on ("overlapping-dependency" "intermediate-dependency") (load-system "main-system")
:perform (load-op (o c) (incf *ms*))) (assert-equal (list *od* *dd* *id* *ms*) '(0 0 1 1))
(DBG "Load it once") (DBG "Loading main-system a second time doesn't reload anything")
(load-system "main-system") (load-system "main-system")
(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")
(with-asdf-session (:override t)
(load-system "main-system" :force '("overlapping-dependency")))
(assert-equal (list *od* *dd* *id* *ms*) '(1 1 1 1)) (assert-equal (list *od* *dd* *id* *ms*) '(1 1 1 1))
(DBG "Load it a second time, forcing od")
(load-system "main-system" :force '("overlapping-dependency"))
(assert-equal (list *od* *dd* *id* *ms*) '(2 2 2 2))
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