test-touch-system-2.script 1.07 KB
Newer Older
1 2
;;; -*- Lisp -*-

3
;;; test system definition NOT reloaded if touched
4 5
;;; system that canNOT be found using *system-definition-search-functions*

6 7
(setf asdf::*asdf-session* (make-instance asdf::*asdf-session-class*))

8
(defun system-registered-time (name)
9 10 11
  (asdf::component-operation-time
   'asdf::define-op
   (registered-system (primary-system-name name))))
12

13 14 15 16
(asdf::clear-registered-systems)
(defparameter test-asdf.asd (nth-value 2 (locate-system :test-asdf)))
(assert-pathname-equal test-asdf.asd (test-source "test-asdf.asd"))
(assert (not (registered-system :test-asdf))) ;; not loaded
17

18
(asdf::clear-registered-systems)
19
(setf asdf:*central-registry* nil)
20 21 22
(load-asd test-asdf.asd)
(assert (registered-system :test-asdf))
(defparameter date1 (system-registered-time :test-asdf))
23
(assert date1)
24
(assert-equal 1 test-asdf-system::*times-loaded*)
25

26 27 28 29 30
(asdf::clear-registered-systems)
(touch-file test-asdf.asd :timestamp date1 :offset +2)
(load-asd test-asdf.asd)
(find-system :test-asdf)
(defparameter date2 (system-registered-time :test-asdf))
31
(assert date2)
32
(assert-compare (> date2 date1))