test-retry-loading-component-1.script 1.25 KB
Newer Older
Gary King's avatar
Gary King committed
1 2 3 4
;;; -*- Lisp -*-

;;; test asdf:try-recompiling restart

5
(load "script-support.lisp")
6
(load-asdf)
7
(defvar *caught-error* nil)
8
(with-test ()
9 10
 (DBG "trlc1 1")
 (asdf::delete-file-if-exists "try-reloading-dependency.asd")
Gary King's avatar
Gary King committed
11
 (setf asdf::*defined-systems* (asdf::make-defined-systems-table))
12
 (DBG "trlc1 2")
13
 (handler-bind ((error (lambda (c)
14 15
                         (format t "~&Caught error ~s" c)
                         (setf *caught-error* t)
16 17 18
                         (asdf::concatenate-files
                          '("try-reloading-dependency.hidden")
                          "try-reloading-dependency.asd")
19
                         (DBG "trlc1 5")
20 21
                         (multiple-value-bind (name mode)
                             (find-symbol (symbol-name 'retry) :asdf)
22
                           (DBG "trlc1 6" name mode)
23 24
                           (assert (eq mode :external) nil "Mode of ~s was not external" name)
                           (let ((restart (find-restart name c)))
25
                             (DBG "trlc1 7" name restart)
26 27
                             (assert restart)
                             (when restart (invoke-restart restart)))))))
28
   (DBG "trlc1 3")
Gary King's avatar
Gary King committed
29
   (asdf:oos 'asdf:load-op 'try-reloading-1))
30
 (DBG "trlc1 4")
31
 (assert *caught-error*))