[lift-devel] Interactivity Patch
Gary King
gwking at metabang.com
Tue Jul 21 20:13:49 UTC 2009
Hi Russ,
Thanks for this patch (and sorry that it's taken so long for me to see
it).
Coincidently enough, I made similar changes to the main Lisp in the
last month or so but haven't pushed those out.
I'll look over your changes and merge them with mine and then try to
push them out soon.
thanks again,
On Apr 15, 2009, at 2:56 PM, Russ Tyndall wrote:
> I have been running my lift tests interactively far more than as a
> disconnected process. As such when I got to the debugger I wanted
> to be
> able to inspect test report args and the call stack that lead to that
> error. To that end I have replaced some handler-cases with some
> handler-binds and worked to ensure that when the debugger is invoked,
> the whole stack that generated the debugger is available.
>
> The test suite has only the same two errors failing that were failing
> before this patch, so I dont think I broke anything.
>
> Hope this helps, thanks for the library,
> Russ Tyndall
>
> New patches:
>
> [A bunch of changes to make running lift interactively a more useful
> experience
> Russ Tyndall <russ at acceleration.net>**20090415183650
> by ensuring that the call stack and any arguements are avaialable at
> the debugger.
>
> * Made handler-bind condition binding lambdas have optional
> condition args
> since when invoked from the debugger, they do not get the
> condition
> (which it self signals another error). Also added a restart for
> run-next-test
> * use handler bind instead of handler case in while-measuring, so
> that we get the stack in the invoked debugger
> * replaces a handler-case with a handler-bind, with mostly
> equivalent functionality
> * added the report arguments to the conditions, so that they are
> inspectable in the debugger
> * pass (not *test-break-on-errors?*) to while-measuring instead of
> always T
>
> ] {
> hunk ./dev/lift.lisp 211
> - ((message :initform ""
> - :initarg :message
> - :accessor message))
> + ((message :initform ""
> + :initarg :message
> + :accessor message)
> + (report-args :accessor report-args :initarg :report-
> args :initform nil))
> hunk ./dev/lift.lisp 511
> + :report-args arguments
> hunk ./dev/lift.lisp 525
> + :report-args arguments
> hunk ./dev/lift.lisp 544
> - (ensure-failed (cond)
> + (ensure-failed (&optional cond)
> hunk ./dev/lift.lisp 1360
> - (ensure-failed (condition)
> + (ensure-failed (&optional condition)
> hunk ./dev/lift.lisp 1587
> - (while-measuring (t measure-space measure-seconds)
> + (while-measuring ((not *test-break-on-errors?*) measure-space
> measure-seconds)
> hunk ./dev/lift.lisp 1607
> - (invoke-debugger condition)
> + (when (with-simple-restart (run-next-test "Run the next test")
> + (invoke-debugger condition))
> + (go :test-end))
> hunk ./dev/macros.lisp 62
> - (handler-case
> - ,@(measure-1 vars measures)
> - (error (c)
> - (setf ,gcondition c)
> - (unless ,gcatch-errors-p
> - (error c)))))
> + (block :here
> + (handler-bind
> + ((error (lambda (c)
> + (setf ,gcondition c)
> + (when ,gcatch-errors-p
> + (return-from :here nil)))))
> + (progn ,@(measure-1 vars measures)))))
> hunk ./dev/measuring.lisp 53
> - (handler-case
> - (progn , at body)
> - (error (c) (setf ,gcondition c)))
> + (handler-bind
> + ((error
> + (lambda (c) ;; let this perkolate up so that stack traces show
> in the debugger
> + (setf ,var (- (,measure-fn) ,ginitial)))))
> + (progn , at body))
> hunk ./dev/measuring.lisp 59
> - (when ,gcondition (error ,gcondition))))))
> + ))))
> }
>
> Context:
>
> [TAG version-1.7.0
> Gary King <gwking at metabang.com>**20090307211551]
> Patch bundle hash:
> 140a8b08f72817cfea790d3705c207584eb9dbbc
> _______________________________________________
> lift-devel mailing list
> lift-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/lift-devel
--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM * gwking on twitter
More information about the lift-devel
mailing list