On 2011-08-26, at 16:28, Lukas Renggli wrote:

> Storing a continuation per failure/error potentially consumes a lot of 
> memory. Memory leaks are also the reason why SUnit doesn't even remeber the 
> exception (which only refer to one or two unwound stack frames). 

point taken. 

> Furthermore continuations interfeer with the guarantees of tearDown methods 
> in test-cases and test-resources. This opens a box full of worms: when do you 
> run them, how often do you run them, how do you ensure a consistent state, …?

right, but they might also help debugging annoying nondeterministic edge cases. 
so I will implement it with an optional setting in the TestRunner. When you 
find an annoying test that won't run consistently you can rerun it with the 
continuation being recorded.

> Lukas
> 
> On Friday, 26 August 2011, Camillo Bruni <[email protected]> wrote:
> >
> > On 2011-08-26, at 16:02, Frank Shearar wrote:
> >
> >> On 26 August 2011 14:54, Camillo Bruni <[email protected]> wrote:
> >>> It always bugged me that SUnit has to rerun the tests again when you want 
> >>> to debug them. So I made a little use-case where exceptions have an 
> >>> optional continuation, so you can resume/debug them later on.
> >>>
> >>> Here's a small example:
> >>>
> >>> |e|
> >>> [ 0 / 0 ]
> >>>        on: Error
> >>>        do: [ :error| e := error freeze ].
> >>> e debug
> >>>
> >>>
> >>> freeze simply creates a continuation (at the moment a full one, but that 
> >>> could be of course reduced to a partial one by the TestRunner). Now when 
> >>> you would click on the failing test result you would simply have to 
> >>> activate the corresponding error by sending #debug to it.
> >>>
> >>> This would have a major advantage for non-deterministic tests (which of 
> >>> course they should not be). Because in this case you're lost with the 
> >>> current SUnit since the debug stack will differ from the actual test-run 
> >>> which produced the error.
> >>>
> >>>
> >>> Needed Changes:
> >>> - Continuations (the one from Seaside will just do fine)
> >>> - Exception >> #freeze saving the continuation
> >>> - TestCase has to store the actual exception
> >>
> >> Hi Camillo,
> >>
> >> Indeed, partial continuations would make an excellent addition to
> >> SUnit. Levente & I discussed doing do a short while back in
> >> squeak-dev. Have you had a look at
> >> http://www.squeaksource.com/Control.html by any chance? It implements
> >> the shift/reset control operator, which is almost what Seaside uses.
> >>
> >> frank
> >
> > No I was unaware of that, having a look at it right now.
> >
> > thanks
> >
> 
> -- 
> Lukas Renggli
> www.lukas-renggli.ch

Reply via email to