Skip to content
Snippets Groups Projects
Commit d50b2723 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Small fixes to doc and tests, notably

be more clever about recompiling asdf.lisp,
and include implementation version in output-translations.
parent bd0a4764
No related branches found
No related tags found
No related merge requests found
......@@ -2123,7 +2123,7 @@ or subdirectories of the path before them, or bust.
The last component, if not a pathname, is notionally completed by @file{/**/*.*}.
You can specify more fine-grained patterns
by using a pathname obj1ect as the last component
by using a pathname object as the last component
e.g. @file{#p"some/path/**/foo*/bar-*.fasl"}
You may use @code{#+features} to customize the configuration file.
......
......@@ -6,7 +6,8 @@
((not (probe-file *asdf-lisp*))
(leave-lisp "Testsuite failed: unable to find ASDF source" 3))
((and (probe-file *asdf-fasl*)
(> (file-write-date *asdf-fasl*) (file-write-date *asdf-lisp*)))
(> (file-write-date *asdf-fasl*) (file-write-date *asdf-lisp*))
(ignore-errors (load *asdf-fasl*)))
(leave-lisp "Reusing previously-compiled ASDF" 0))
(t
(let ((tmp (make-pathname :name "asdf-tmp" :defaults *asdf-fasl*)))
......@@ -29,6 +30,7 @@
#+ecl
(when warnings-p
(format t "~&ASDF compiled with warnings. Please fix ECL.~%"))
(ignore-errors (delete-file *asdf-fasl*))
(when (probe-file *asdf-fasl*)
(delete-file *asdf-fasl*))
(rename-file tmp *asdf-fasl*)
(leave-lisp "ASDF compiled cleanly" 0)))))))
......@@ -165,9 +165,9 @@ if ! type "$command" ; then
exit 43
fi
asdfdir="$(cd .. ; /bin/pwd)"
export CL_SOURCE_REGISTRY="${asdfdir}"
export ASDF_OUTPUT_TRANSLATIONS="${asdfdir}:${asdfdir}/tmp/fasls/$(basename $command):"
ASDFDIR="$(cd .. ; /bin/pwd)"
export CL_SOURCE_REGISTRY="${ASDFDIR}"
export ASDF_OUTPUT_TRANSLATIONS="(:output-translations (\"${ASDFDIR}\" (\"${ASDFDIR}/tmp/fasls\" :implementation)) :ignore-inherited-configuration)"
env | grep asdf
command="$command $flags"
......
......@@ -7,25 +7,21 @@
(asdf:operate 'asdf:load-op 'test-module-depend)
;; test that it compiled
(defvar file1-date (file-write-date (asdf:compile-file-pathname* "file1")))
(let ((file1-date (file-write-date (asdf:compile-file-pathname* "file1"))))
(assert (and file1-date (file-write-date (asdf:compile-file-pathname* "file2"))))
(assert (and file1-date (file-write-date (asdf:compile-file-pathname* "file2"))))
;; and loaded
(assert (eval (intern (symbol-name '#:*file1*) :test-package)))
;; now touch file1 and check that file2 _is_ also recompiled
;; this will only work if the cross-module (intra-system)
;; dependency bug is fixed.
(let ((before (file-write-date (asdf:compile-file-pathname* "file2"))))
(asdf::run-shell-command "touch file1.lisp")
(sleep 1)
(asdf:operate 'asdf:load-op 'test-module-depend)
(assert (> (file-write-date (asdf:compile-file-pathname* "file2")) before))
;; does this properly go to the second level?
(assert (> (file-write-date (asdf:compile-file-pathname* "file3")) before))
))
;; and loaded
(assert (eval (intern (symbol-name '#:*file1*) :test-package)))
;; now touch file1 and check that file2 _is_ also recompiled
;; this will only work if the cross-module (intra-system)
;; dependency bug is fixed.
(let ((before (file-write-date (asdf:compile-file-pathname* "file2"))))
(asdf::run-shell-command "touch file1.lisp")
(sleep 1)
(asdf:operate 'asdf:load-op 'test-module-depend)
(assert (> (file-write-date (asdf:compile-file-pathname* "file2")) before))
;; does this properly go to the second level?
(assert (> (file-write-date (asdf:compile-file-pathname* "file3")) before)))))
......@@ -10,14 +10,14 @@
:depends-on ("file1")
:components ((:file "file2")))))
(defun find-file2 ()
(find-component (find-quux) "file2"))
(defun find-quux ()
(find-component
(find-system :test-module-excessive-depend)
"quux"))
(defun find-file2 ()
(find-component (find-quux) "file2"))
(defmethod component-depends-on ((op load-op)
(c (eql (find-file2))))
(cons (cons 'load-op (list "file3-only"))
......@@ -31,9 +31,7 @@
(defmethod find-component :around ((m (eql (find-quux)))
(c string) &optional version)
"FIND-COMPONENT on a component is a no-op --- it's already found."
(declare (ignore version))
(if (string-equal c "file3-only")
(asdf:find-system c)
(call-next-method)))
......@@ -20,46 +20,43 @@
(asdf:operate 'asdf:load-op 'test-module-excessive-depend)
;; test that it compiled
(defvar file1-date (file-write-date (asdf:compile-file-pathname* "file1")))
(defvar file2-date (file-write-date (asdf:compile-file-pathname* "file2")))
(defvar file3-date (file-write-date (asdf:compile-file-pathname* "file3")))
(unless (and file1-date file2-date file3-date)
(error "Failed to compile one of the three files that should be compiled for this test: ~{~a~}"
(mapcar #'cdr
(remove-if #'car
(pairlis (list file1-date file2-date file3-date)
'("file1" "file2" "file3"))))))
;; and loaded
(assert (eval (intern (symbol-name '#:*file1*) :test-package)))
(assert (eval (intern (symbol-name '#:*file3*) :test-package)))
;; now touch file1 and check that file2 _is_ also recompiled
;; but that file3 is _not_ recompiled.
;; this will only work if the cross-module (intra-system)
;; dependency bug is fixed and the excessive compilation bug is fixed.
(let ((before file2-date))
(asdf::run-shell-command "touch file1.lisp")
(sleep 1)
(let ((plan (asdf::traverse
(make-instance 'asdf:load-op)
(asdf:find-system 'test-module-excessive-depend)))
(file3-only (asdf:find-system 'file3-only)))
(let ((file1-date (file-write-date (asdf:compile-file-pathname* "file1")))
(file2-date (file-write-date (asdf:compile-file-pathname* "file2")))
(file3-date (file-write-date (asdf:compile-file-pathname* "file3"))))
(unless (and file1-date file2-date file3-date)
(error "Failed to compile one of the three files ~
that should be compiled for this test: ~{~a~}"
(mapcar #'cdr
(remove-if #'car
(pairlis (list file1-date file2-date file3-date)
'("file1" "file2" "file3"))))))
;; and loaded
(assert (eval (intern (symbol-name '#:*file1*) :test-package)))
(assert (eval (intern (symbol-name '#:*file3*) :test-package)))
;; now touch file1 and check that file2 _is_ also recompiled
;; but that file3 is _not_ recompiled.
;; this will only work if the cross-module (intra-system)
;; dependency bug is fixed and the excessive compilation bug is fixed.
(let ((before file2-date))
(asdf::run-shell-command "touch file1.lisp")
(sleep 1)
(let ((plan (asdf::traverse
(make-instance 'asdf:load-op)
(asdf:find-system 'test-module-excessive-depend)))
(file3-only (asdf:find-system 'file3-only)))
;;; (format t "~%Operation plan is:~%")
;;; (pprint plan)
;;; (format t "Target system is: ~a" file3-only)
(when (find file3-only plan :key #'cdr)
(error "Excessive operations on file3-only system. Bad propagation of dependencies.")))
(asdf:operate 'asdf:load-op 'test-module-excessive-depend)
(assert (> (file-write-date (asdf:compile-file-pathname* "file2")) before))
(assert (> (file-write-date (asdf:compile-file-pathname* "file2")) before))
)
(unless (= (file-write-date (asdf:compile-file-pathname* "file3"))
file3-date)
(error "Excessive compilation of file3.lisp: traverse bug."))
)
(when (find file3-only plan :key #'cdr)
(error "Excessive operations on file3-only system. Bad propagation of dependencies.")))
(asdf:operate 'asdf:load-op 'test-module-excessive-depend)
(assert (> (file-write-date (asdf:compile-file-pathname* "file2")) before))
(assert (> (file-write-date (asdf:compile-file-pathname* "file2")) before))
)
(unless (= (file-write-date (asdf:compile-file-pathname* "file3"))
file3-date)
(error "Excessive compilation of file3.lisp: traverse bug."))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment