test-static-and-serial.script 1.78 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
(setf asdf::*asdf-session* (make-instance asdf::*asdf-session-class*))

11 12 13 14 15 16 17 18 19 20
(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)
21

22 23 24 25
(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"))))
26 27 28
(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"))
29 30
(assert-pathname-equal file1.fasl (test-fasl "file1")) ;; differ on CCL. Sigh.
(defparameter file1-date (get-file-stamp file1.fasl))
31 32 33
(defparameter date1 (- file1-date 600))
(defparameter date2 (- file1-date 300))
(defparameter date3 (- file1-date 150))
34

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

39 40 41 42
;; date should stay same
(clear-system 'static-and-serial)
(delete-package :test-package)
(eval s)
43 44 45 46
(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)
47
(DBG "load again" (oos 'load-op 'static-and-serial))
48
(assert (asymval :*file1* :test-package))
49
(assert-equal (get-file-stamp file1.fasl) date3)