Skip to content
Snippets Groups Projects
Commit fe907bbd authored by Robert P. Goldman's avatar Robert P. Goldman
Browse files

Cleaned up a bunch of debugging cruft.

Test still doesn't work, but that seems to be because the testing code
itself establishes an ASDF cache, making the restart I want inaccessible
from test code.
parent 9ee02fc8
No related branches found
No related tags found
No related merge requests found
......@@ -17,37 +17,38 @@
(DBG "Clearing the caches and finding.")
(clear-caches-and-search)
(assert (not (asdf:find-system "test-asdf/force1" nil)))
(let (tried-once)
(handler-bind
((asdf:missing-dependency-of-version
(lambda (c)
;; Nothing Quicklisp can do to recover from this, so
;; just resignal
(error c)))
(asdf:missing-dependency
(lambda (c)
(if (not tried-once)
(let ((missing (asdf::missing-requires c)))
(assert (equal missing "test-asdf/force1"))
(setf tried-once t)
(DBG "Trying to reset the central registry and retry.")
(setf asdf:*central-registry* *old-registry*)
(asdf:find-system missing))
;; avoid infinite looping
(error c)))))
(asdf:find-system "test-asdf/force1")))
(DBG "Correctly failed to find system.")
(assert
(let (tried-once)
(handler-bind
((asdf:missing-component
#'(lambda (c)
(DBG "Caught MISSING-COMPONENT condition.")
(if (not tried-once)
(let ((missing (asdf::missing-requires c)))
(assert (equal missing "test-asdf/force1"))
(setf tried-once t)
(setf asdf:*central-registry* *old-registry*)
(invoke-restart 'asdf:reinitialize-source-registry-and-retry)
)
;; avoid infinite looping
(error c)))))
(asdf:find-system "test-asdf/force1" t))))
(DBG "Refinding test successful.")
(DBG "Now trying LOAD-SYSTEM with refinding.")
(clear-caches-and-search)
(trace find-system)
(trace find-component)
(trace asdf::component-find-path)
(trace operate)
(def-test-system test-missing-dependency
:depends-on ("test-asdf/force1")
:components ((:file "file2")))
;; (trace find-system)
;; (trace find-component)
;; (trace asdf::component-find-path)
;; (trace operate)
(let (tried-once)
(flet ((handle-missing (c)
(if (not tried-once)
(if (not tried-once)
(let ((missing (asdf::missing-requires c)))
(assert (equal missing "test-asdf/force1"))
(setf tried-once t)
......@@ -55,25 +56,25 @@
(setf asdf:*central-registry* *old-registry*)
(unless (find-restart 'asdf:reinitialize-source-registry-and-retry)
(error "Expected REINITIALIZE-SOURCE-REGISTRY-AND-RETRY restart not found."))
(DBG "Before invoking restart, CENTRAL-REGISTRY is:~%~T~S"
(DBG "Before invoking restart, CENTRAL-REGISTRY is:"
asdf:*central-registry*)
(invoke-restart 'asdf:reinitialize-source-registry-and-retry)
(DBG "After invoking restart, CENTRAL-REGISTRY is:~%~T~S"
(DBG "After invoking restart, CENTRAL-REGISTRY is:"
asdf:*central-registry*))
;; avoid infinite looping
(error c))))
(handler-bind
((asdf:missing-dependency-of-version
(lambda (c)
#'(lambda (c)
;; Nothing Quicklisp can do to recover from this, so
;; just resignal
(error c)))
(asdf:missing-dependency
(lambda (c)
#'(lambda (c)
(DBG "Catching MISSING-DEPENDENCY condition:" tried-once)
(handle-missing c)))
(asdf:missing-component
(lambda (c)
#'(lambda (c)
(DBG "Catching MISSING-COMPONENT condition:" tried-once)
(handle-missing c))))
(asdf:load-system "test-asdf/force1"))))
(asdf:load-system "test-missing-dependency"))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment