File: test1.script

package info (click to toggle)
cl-asdf 1.111-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 428 kB
  • ctags: 189
  • sloc: lisp: 1,395; sh: 128; makefile: 41
file content (36 lines) | stat: -rw-r--r-- 1,288 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
;;; -*- Lisp -*-
(load "script-support")
(load "../asdf")
(exit-on-error 
 (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*)

(exit-on-error 
 ;; 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)))
 )