test-touch-system-1.script 771 Bytes
Newer Older
1 2 3 4 5
;;; -*- Lisp -*-

;;; test system def reloading if touched
;;; system that can be found using *system-definition-search-functions*

6
(load-asdf)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

(defun system-load-time (name)
  (if-let (data (asdf::system-registered-p name))
    (car data)))
(defparameter file "test1.asd")
(defparameter date1 (file-write-date file))
(defparameter date2 (- date1 600))
(defparameter date3 (- date1 300))
(touch-file file :timestamp date2)
(asdf:find-system :test1)
(defparameter date4 (file-write-date (test-fasl "file1.lisp")))
(defparameter date5 (system-load-time :test1))
(DBG :blah date2 date3 date4 date5)
(assert-equal date2 date5)
(assert (>= date4 date3))
(sleep 1)
(touch-file file)
(find-system :test1)
(defparameter date6 (system-load-time :test1))
(assert (> date6 date4))