Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
asdf
asdf
Commits
69738939
Commit
69738939
authored
Sep 11, 2016
by
Francois-Rene Rideau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit test-force to reveal bad require-system behavior.
parent
016d6bae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
4 deletions
+57
-4
test/file1.lisp
test/file1.lisp
+1
-1
test/file3.lisp
test/file3.lisp
+1
-1
test/test-asdf.asd
test/test-asdf.asd
+3
-0
test/test-force.script
test/test-force.script
+52
-2
No files found.
test/file1.lisp
View file @
69738939
(
defpackage
:test-package
(
:use
:cl
))
(
in-package
:test-package
)
(
def
va
r
*file1*
t
)
(
def
paramete
r
*file1*
t
)
test/file3.lisp
View file @
69738939
(
defpackage
:test-package
(
:use
:cl
))
(
in-package
:test-package
)
(
def
va
r
*file3*
t
)
(
def
paramete
r
*file3*
t
)
test/test-asdf.asd
View file @
69738939
...
...
@@ -2,6 +2,9 @@
(
:use
:cl
:asdf
))
(
in-package
:test-asdf-system
)
(
defvar
*times-loaded*
0
)
(
incf
*times-loaded*
)
(
defsystem
:test-asdf
:class
package-inferred-system
)
(
defsystem
:test-asdf/all
...
...
test/test-force.script
View file @
69738939
;;; -*- Lisp -*-
(load-system 'test-asdf/force)
(clear-system 'test-asdf/force)
(assert (not (component-loaded-p 'test-asdf/force)))
(require-system 'test-asdf/force)
(assert (component-loaded-p 'test-asdf/force))
(assert-equal (asymval :*file3* :test-package) t)
(assert-equal (asymval :*times-loaded* :test-asdf-system) 1)
(defparameter file1 (test-fasl "file1"))
(defparameter file1-date (file-write-date file1))
...
...
@@ -35,6 +41,11 @@
(DBG "Check that :force-not :all takes precedence over :force" plan)
(assert (null plan)))
(let ((plan (traverse 'load-op 'test-asdf/force :force :all
:force-not '(:test-asdf/force :test-asdf/force1))))
(DBG "Check that :force-not :all takes precedence over :force" plan)
(assert (null plan)))
(let* ((*immutable-systems* (list-to-hash-set '("test-asdf/force1")))
(plan (traverse 'load-op 'test-asdf/force :force :all :force-not t)))
(DBG "Check that immutable-systems will block forcing" plan)
...
...
@@ -46,9 +57,48 @@
(touch-file "test-asdf.asd" :timestamp date1)
(touch-file "file1.lisp" :timestamp date1)
(touch-file file1 :timestamp date2)
(load-system 'test-asdf/force)
(setf test-package::*file1* :modified)
(DBG "Check the fake dates from touch-file")
(assert-equal (get-file-stamp "test-asdf.asd") date1)
(assert-equal (get-file-stamp "file1.lisp") date1)
(assert-equal (get-file-stamp file1) date2)
(DBG "Check that require-system won't reload")
(require-system 'test-asdf/force1)
(assert-equal (get-file-stamp file1) date2)
(assert-equal test-package::*file1* :modified)
(DBG "Check that load-system will reload")
(load-system 'test-asdf/force1)
(assert-equal (get-file-stamp file1) date2)
(assert-equal test-package::*file1* t)
;; forced, it should be later
(DBG "Check that force reloading loads again")
(setf test-package::*file3* :reset)
(load-system 'test-asdf/force :force :all)
(assert-compare (>= (get-file-stamp file1) file1-date))
(assert-equal test-package::*file3* t)
(DBG "Check that test-asdf was loaded only once all along")
(assert-equal (asymval :*times-loaded* :test-asdf-system) 1)
(setf test-package::*file3* :reset)
(DBG "Check that require-system of touched .asd will reload the asdf.")
(DBG "(That's what it does now, but if it could be fixed that'd be nice.)")
(unset-asdf-cache-entry '(locate-system "test-asdf"))
(unset-asdf-cache-entry '(find-system "test-asdf"))
(unset-asdf-cache-entry '(find-system "test-asdf/force"))
(touch-file "test-asdf.asd" :timestamp (+ 10000 (get-file-stamp file1)))
(require-system 'test-asdf/force)
(assert-equal (asymval :*times-loaded* :test-asdf-system) 2)
(assert-equal test-package::*file3* :reset)
(DBG "Check that require-system of untouched .asd won't reload the asdf.")
(require-system 'test-asdf/force)
;;; Somehow, it loads the system...
(with-expected-failure (t)
(assert-equal (asymval :*times-loaded* :test-asdf-system) 2)
(assert-equal test-package::*file3* :reset))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment