Commit f38b3471 authored by Robert Goldman's avatar Robert Goldman

Test update on included file change.

Test to see if systems are reloaded when files included in them using
either :READ-FILE-FORM or :READ-FILE-LINE are changed.
parent ff7c9888
;;;---------------------------------------------------------------------------
;;; Sample system to test inclusion of lines from other files and
;;; correct reasoning about system modifications.
;;;---------------------------------------------------------------------------
(defsystem test-include
:version (:read-file-form "../build/random-version.lisp-expr")
:components ((:file "file2" :in-order-to ((compile-op (load-op "file1"))
(load-op (load-op "file1"))))
(:file "file1")))
\ No newline at end of file
;;; -*- Lisp -*-
;;; ---------------------------------------------------------------------------
;;; Test to make sure that an update to included files causes a reload
;;; of the system definition.
;;; ---------------------------------------------------------------------------
(in-package :asdf-test)
;; I don't know what this does or when it's necessary
;; (setf asdf::*asdf-session* (make-instance asdf::*asdf-session-class*))
(defparameter *tmp-directory* (subpathname *asdf-directory* "build/"))
(defun under-tmp-directory (designator &optional (defaults *tmp-directory*))
(namestring (subpathname defaults designator)))
(defparameter *version-file*
(under-tmp-directory "random-version.lisp-expr"))
;;; write an initial version file
(with-open-file (str *version-file* :direction :output
:if-exists :supersede)
(format str "\"1.0\"~%"))
(asdf:load-system "test-include")
(let ((system (asdf:find-system "test-include")))
;; read the initial version information correctly...
(assert-equal (asdf:component-version system) "1.0"))
;;; bump the version
(with-open-file (str *version-file* :direction :output
:if-exists :supersede)
(format str "\"2.0\"~%"))
(asdf:load-system "test-include")
(let ((system (asdf:find-system "test-include")))
;; read the initial version information correctly...
(assert-equal (asdf:component-version system) "2.0"))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment