test-touch-system-1.script 936 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 "script-support.lisp")
7
(load-asdf)
8
(quit-on-error
9
 (flet ((system-load-time (name)
10 11 12
          (let ((data (asdf::system-registered-p name)))
            (when data
              (car data)))))
13 14 15 16 17
   (let* ((file "test1.asd")
          (date1 (file-write-date file))
          (date2 (- date1 600))
          (date3 (- date1 300)))
     (touch-file file :timestamp date2)
18
     (asdf:find-system :test1)
19 20 21 22 23 24 25 26 27 28 29
     (let ((date4 (file-write-date (asdf::compile-file-pathname* "file1.lisp")))
           (date5 (system-load-time :test1)))
       (DBG :blah date2 date3 date4 date5)
       (assert-equal date2 date5)
       (assert (>= date4 date3))
       (sleep 1)
       (touch-file file)
       (asdf:find-system :test1)
       (let ((date6 (system-load-time :test1)))
         (assert (> date6 date4)))))))