test-static-and-serial.script 1.71 KB
Newer Older
1
;;; -*- Lisp -*-
2 3 4 5
#|
make sure that serial t and static-files
don't cause full rebuilds all the time...
|#
6

7
(in-package :asdf-test)
8

9 10 11 12 13 14 15 16 17 18
(defparameter s
  '(def-test-system static-and-serial
    :version "0.1"
    :serial t
    :components
    ((:static-file "file2.lisp")
     (:static-file "run-tests.sh")
     (:file "file1"))))
(eval s)
(load-test-system 'static-and-serial)
19

20 21 22 23
(defparameter file1.lisp (component-pathname (find-component 'static-and-serial "file1")))
(defparameter file2.lisp (component-pathname (find-component 'static-and-serial "file2.lisp")))
(defparameter run-tests.sh (component-pathname (find-component 'static-and-serial "run-tests.sh")))
(defparameter file1.fasl (first (output-files 'compile-op '(static-and-serial "file1"))))
24 25 26
(assert-pathname-equal file1.lisp (test-source "file1.lisp")) ;; differ on LispWorks. Sigh.
(assert-pathname-equal file2.lisp (test-source "file2.lisp"))
(assert-pathname-equal run-tests.sh (test-source "run-tests.sh"))
27 28
(assert-pathname-equal file1.fasl (test-fasl "file1")) ;; differ on CCL. Sigh.
(defparameter file1-date (get-file-stamp file1.fasl))
29 30 31
(defparameter date1 (- file1-date 600))
(defparameter date2 (- file1-date 300))
(defparameter date3 (- file1-date 150))
32

33
(assert file1-date)
34
(assert (asymval :*file1* :test-package))
35
(format t "file: ~S~%date: ~S~%" file1.fasl file1-date)
36

37 38 39 40
;; date should stay same
(clear-system 'static-and-serial)
(delete-package :test-package)
(eval s)
41 42 43 44
(touch-file file2.lisp :timestamp date1)
(touch-file run-tests.sh :timestamp date1)
(touch-file file1.lisp :timestamp date2)
(touch-file file1.fasl :timestamp date3)
45
(DBG "load again" (oos 'load-op 'static-and-serial))
46
(assert (asymval :*file1* :test-package))
47
(assert-equal (get-file-stamp file1.fasl) date3)