(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)
(progn
#+clozure (setf ccl:*default-external-format* :latin3)
#+sbcl (setf sb-impl::*default-external-format* :latin-3)
(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))
+++ /dev/null
-;;; -*- 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")))
(load-asdf)
(quit-on-error
- (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"
:type "lisp"
:defaults
*default-pathname-defaults*))))
- (asdf::run-shell-command
- (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)
(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)))))
;; 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))))
(let ((data (asdf::system-registered-p name)))
(when data
(car data)))))
- (setf asdf:*central-registry* '(*default-pathname-defaults*))
- (asdf:find-system :test1)
- (let ((date1 (system-load-time :test1))
- (file (namestring (merge-pathnames "test1.asd"))))
- (assert date1)
- (assert file)
- (sleep 1)
- (touch-file file)
+ (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 ((date2 (system-load-time :test1)))
- (print (list date1 date2))
- (assert date2)
- (assert (> date2 date1))))))
-
+ (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)))))))
+
\ No newline at end of file
(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")