test-module-depend.script 1.52 KB
Newer Older
1
;;; -*- Lisp -*-
2

3 4
(setf asdf::*asdf-session* (make-instance asdf::*asdf-session-class*))

5
(load-system 'test-module-depend)
6

7
;; test that it compiled
8
(defparameter file1.lisp (component-pathname (find-component 'test-module-depend "file1")))
9 10 11
(defparameter file1.fasl (first (output-files 'compile-op '(test-module-depend "file1"))))
(defparameter file2.fasl (first (output-files 'compile-op '(test-module-depend "quux" "file2"))))
(defparameter file3.fasl (first (output-files 'compile-op '(test-module-depend "quux" "file3mod" "file3"))))
12 13
(defparameter file1-date (get-file-stamp file1.fasl))
(defparameter file3-date (get-file-stamp file3.fasl))
14 15 16
(assert-pathname-equal file1.fasl (test-fasl "file1"))
(assert-pathname-equal file2.fasl (test-fasl "file2"))
(assert-pathname-equal file3.fasl (test-fasl "file3"))
17

18 19
(assert file1-date)
(assert file3-date)
20

21
;; and loaded
22
(assert (asymval '#:*file1* :test-package))
23

24 25 26
;; now touch file1 and its fasl so the fasl is out of date,
;; and check that file2 _is_ also recompiled
;; this didn't work before the cross-module (intra-system) dependency bug was fixed.
27

28
(touch-file file1.lisp :timestamp (- file3-date 60))
29 30 31
(touch-file file1.fasl :timestamp (- file3-date 90))
(touch-file file2.fasl :timestamp (- file3-date 30))
(touch-file file3.fasl :timestamp (- file3-date 15))
32
(reset-session-visited)
33
(load-system 'test-module-depend)
34
(assert-compare (>= (- (get-file-stamp file2.fasl) file3-date) 0))
35
;; does this properly go to the second level?
36
(assert-compare (>= (- (get-file-stamp file3.fasl) file3-date) 0))