diff options
Diffstat (limited to 'Lisp/asdf/test/test1.script')
-rw-r--r-- | Lisp/asdf/test/test1.script | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Lisp/asdf/test/test1.script b/Lisp/asdf/test/test1.script new file mode 100644 index 0000000..f39882c --- /dev/null +++ b/Lisp/asdf/test/test1.script @@ -0,0 +1,32 @@ +;;; -*- Lisp -*- +(load "../asdf") +(setf asdf:*central-registry* '(*default-pathname-defaults*)) +(asdf:operate 'asdf:load-op 'test1) + +;; test that it compiled +(defvar file1-date (file-write-date (compile-file-pathname "file1"))) +(assert (and file1-date (file-write-date (compile-file-pathname "file2")))) + +;; and loaded +(assert test-package::*file1*) + +;; now remove one output file and check that the other is _not_ +;; recompiled +(sleep 1) ; mtime has 1-second granularity, so pause here for fast machines + +(asdf::run-shell-command "rm ~A" + (namestring (compile-file-pathname "file2"))) +(asdf:operate 'asdf:load-op 'test1) +(assert (= file1-date (file-write-date (compile-file-pathname "file1")))) +(assert (file-write-date (compile-file-pathname "file2"))) + +;; now touch file1 and check that file2 _is_ also recompiled + +;; XXX run-shell-command loses if *default-pathname-defaults* is not the +;; unix cwd. this is not a problem for run-tests.sh, but can be in general + +(let ((before (file-write-date (compile-file-pathname "file2")))) + (asdf::run-shell-command "touch file1.lisp") + (sleep 1) + (asdf:operate 'asdf:load-op 'test1) + (assert (> (file-write-date (compile-file-pathname "file2")) before))) |