Commit cca259c4 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Fix tests broken by recent touch changes.

parent 5659fed3
......@@ -43,7 +43,9 @@
(defsystem :test-encoding-explicit-u8
:components ((:file "lambda" :encoding :utf-8))))
#+(and asdf-unicode (or clozure sbcl))
;; NB: recent clozure can autodetect without asdf-encodings with :default (!)
#+(and asdf-unicode sbcl)
#+clozure (setf ccl:*default-external-format* :latin3)
#+sbcl (setf sb-impl::*default-external-format* :latin-3)
......@@ -15,8 +15,8 @@
(assert file1-date)
;; unforced, date should stay same
(touch-file "file1.lisp" date1)
(touch-file file1 date2)
(touch-file "file1.lisp" :timestamp date1)
(touch-file file1 :timestamp date2)
(asdf:operate 'asdf:load-op 'test-force)
(assert (equal (file-write-date file1) date2))
;;; -*- Lisp -*-
(asdf:defsystem test-missing-lisp-file
:components ((:file "file2" :in-order-to ((compile-op (load-op "fileMissing"))
(load-op (load-op "fileMissing"))))
(:file "fileMissing")))
......@@ -10,7 +10,10 @@
(setf asdf:*central-registry* '(*default-pathname-defaults*))
(asdf:defsystem test-missing-lisp-file
:components ((:file "file2" :in-order-to ((compile-op (load-op "fileMissing"))
(load-op (load-op "fileMissing"))))
(:file "fileMissing")))
(let ((missing-name (namestring
(make-pathname :name "fileMissing"
:type "lisp"
......@@ -21,8 +24,7 @@
:type "lisp"
(format nil "cp ~a ~a" template-file missing-name))
(asdf::concatenate-files (list template-file) missing-name)
(unless (probe-file missing-name)
(format t "File copy failed.~%"))
(asdf:operate 'asdf:load-op 'test-missing-lisp-file)
......@@ -38,9 +40,8 @@
(assert (symbol-value (find-symbol (symbol-name :*file1*) :test-package)))
;; now remove the lisp file we created, and wait for an error
(sleep 1) ; mtime has 1-second granularity, so pause here for fast machines
(asdf::run-shell-command (format nil "rm -f ~A" missing-name))
(asdf::delete-file-if-exists missing-name)
;; we shouldn't be able to find the input-file for the compile-op, and that
;; should be an error.
(let ((err (nth-value 1 (ignore-errors (asdf:operate 'asdf:load-op 'test-missing-lisp-file)))))
......@@ -23,8 +23,8 @@
;; date should stay same
(asdf:clear-system 'static-and-serial)
(touch-file "file2.lisp" date1)
(touch-file "file1.lisp" date2)
(touch-file file1 date3)
(touch-file "file2.lisp" :timestamp date1)
(touch-file "file1.lisp" :timestamp date2)
(touch-file file1 :timestamp date3)
(asdf:operate 'asdf:load-op 'static-and-serial)
(assert (equal (file-write-date file1) date3))))
......@@ -10,17 +10,20 @@
(let ((data (asdf::system-registered-p name)))
(when data
(car data)))))
(setf asdf:*central-registry* '(*default-pathname-defaults*))
(let* ((file "test1.asd")
(date1 (file-write-date file))
(date2 (- date1 600))
(date3 (- date1 300)))
(touch-file file :timestamp date2)
(asdf:find-system :test1)
(let ((date1 (system-load-time :test1))
(file (namestring (merge-pathnames "test1.asd"))))
(assert date1)
(assert file)
(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 ((date2 (system-load-time :test1)))
(print (list date1 date2))
(assert date2)
(assert (> date2 date1))))))
(let ((date6 (system-load-time :test1)))
(assert (> date6 date4)))))))
\ No newline at end of file
......@@ -10,24 +10,27 @@
(let* ((file1 (asdf:compile-file-pathname* "file1"))
(file2 (asdf:compile-file-pathname* "file2"))
(file1-date (file-write-date file1))
(file2-date (file-write-date file2)))
(file2-date (file-write-date file1)))
(DBG "test that it compiled" file1 file1-date)
(assert file1-date)
(assert file2-date)
(touch-file file1 :timestamp (- file1-date 200))
(touch-file file2 :timestamp (- file1-date 100))
(DBG "and loaded")
(assert (symbol-value (find-symbol (symbol-name :*file1*) :test-package)))
(DBG "now remove file2 that depends-on file1" file1-date (- file1-date 120))
(touch-file file1 :timestamp (- file1-date 120)) ;; move file1.fasl two minutes ago.
(assert-equal (- file1-date 120) (file-write-date file1))
(touch-file file1 :timestamp (- file1-date 150)) ;; move file1.fasl two minutes ago.
(assert-equal (- file1-date 150) (file-write-date file1))
(asdf::delete-file-if-exists file2)
(DBG "load again")
(asdf:clear-system 'test1)
(asdf:load-system 'test1)
(DBG "check that file1 is _not_ recompiled, but file2 is" (file-write-date file1))
(assert-equal (- file1-date 120) (file-write-date file1))
(assert-equal (- file1-date 150) (file-write-date file1))
(assert (<= file2-date (file-write-date file2)))
(DBG "now touch file1 and check that file2 _is_ also recompiled")
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