From gwking at metabang.com Tue Jul 21 20:13:49 2009 From: gwking at metabang.com (Gary King) Date: Tue, 21 Jul 2009 16:13:49 -0400 Subject: [lift-devel] Interactivity Patch In-Reply-To: <49E62DE0.3080109@acceleration.net> References: <49E62DE0.3080109@acceleration.net> Message-ID: <825DE189-7676-4B92-AFC7-EBC39F2B9AA1@metabang.com> 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 **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 **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