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
Loading
Loading
Loading
Loading
+31 −30
Original line number Diff line number Diff line
@@ -17,34 +17,35 @@
(DBG "Clearing the caches and finding.")
(clear-caches-and-search)
(assert (not (asdf:find-system "test-asdf/force1" nil)))
(DBG "Correctly failed to find system.")
(assert
 (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)
       ((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)
             (DBG "Trying to reset the central registry and retry.")
                    (setf asdf:*central-registry* *old-registry*)
             (asdf:find-system missing))
                    (invoke-restart 'asdf:reinitialize-source-registry-and-retry)
                    )
                  ;; avoid infinite looping
                  (error c)))))
 (asdf:find-system "test-asdf/force1")))
     (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)
@@ -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"))))