Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asdf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Didier Verna
asdf
Commits
69738939
Commit
69738939
authored
8 years ago
by
Francois-Rene Rideau
Browse files
Options
Downloads
Patches
Plain Diff
Edit test-force to reveal bad require-system behavior.
parent
016d6bae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
test/file1.lisp
+1
-1
1 addition, 1 deletion
test/file1.lisp
test/file3.lisp
+1
-1
1 addition, 1 deletion
test/file3.lisp
test/test-asdf.asd
+3
-0
3 additions, 0 deletions
test/test-asdf.asd
test/test-force.script
+52
-2
52 additions, 2 deletions
test/test-force.script
with
57 additions
and
4 deletions
test/file1.lisp
+
1
−
1
View file @
69738939
(
defpackage
:test-package
(
:use
:cl
))
(
in-package
:test-package
)
(
def
va
r
*file1*
t
)
(
def
paramete
r
*file1*
t
)
This diff is collapsed.
Click to expand it.
test/file3.lisp
+
1
−
1
View file @
69738939
(
defpackage
:test-package
(
:use
:cl
))
(
in-package
:test-package
)
(
def
va
r
*file3*
t
)
(
def
paramete
r
*file3*
t
)
This diff is collapsed.
Click to expand it.
test/test-asdf.asd
+
3
−
0
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
...
...
This diff is collapsed.
Click to expand it.
test/test-force.script
+
52
−
2
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))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment