Skip to content
Snippets Groups Projects
Commit 5659fed3 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Make some time-dependent tests more robusts with touch.

parent 594b9e06
No related branches found
No related tags found
No related merge requests found
......@@ -7,17 +7,19 @@
(asdf:operate 'asdf:load-op 'test-force)
(let* ((file1 (asdf:compile-file-pathname* "file1"))
(file1-date (file-write-date file1)))
(file1-date (file-write-date file1))
(date1 (- file1-date 600))
(date2 (- file1-date 300)))
(assert file1)
(assert file1-date)
;; unforced, date should stay same
(sleep 1)
(touch-file "file1.lisp" date1)
(touch-file file1 date2)
(asdf:operate 'asdf:load-op 'test-force)
(assert (equal (file-write-date file1) file1-date))
(assert (equal (file-write-date file1) date2))
;; forced, it should be later
(sleep 1)
(asdf:operate 'asdf:load-op 'test-force :force t)
(assert (> (file-write-date file1) file1-date))))
(assert (>= (file-write-date file1) file1-date))))
......@@ -13,12 +13,18 @@
(asdf:operate 'asdf:load-op 'static-and-serial)
(let* ((file1 (asdf:compile-file-pathname* "file1.lisp"))
(file1-date (file-write-date file1)))
(file1-date (file-write-date file1))
(date1 (- file1-date 600))
(date2 (- file1-date 300))
(date3 (- file1-date 150)))
(assert file1-date)
(format t "file: ~S~%date: ~S~%" file1 file1-date)
;; date should stay same
(asdf:clear-system 'static-and-serial)
(sleep 1)
(touch-file "file2.lisp" date1)
(touch-file "file1.lisp" date2)
(touch-file file1 date3)
(asdf:operate 'asdf:load-op 'static-and-serial)
(assert (equal (file-write-date file1) file1-date))))
(assert (equal (file-write-date file1) date3))))
......@@ -6,7 +6,7 @@
(DBG "loading test1")
(touch-file "file1.lisp" :offset -600) ;; touch file1.lisp 10 minutes ago.
(touch-file "file2.lisp" :offset -300) ;; touch file2.lisp 5 minutes ago.
(asdf:load-system 'test1)
(asdf:load-system 'test1 :force t)
(let* ((file1 (asdf:compile-file-pathname* "file1"))
(file2 (asdf:compile-file-pathname* "file2"))
(file1-date (file-write-date file1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment