[squeak-dev] Why is TestFailure non-resumable?

Eliot Miranda eliot.miranda at gmail.com
Sat Sep 12 22:37:45 UTC 2009


On Sat, Sep 12, 2009 at 2:22 PM, Colin Putney <cputney at wiresong.ca> wrote:

>
> On 10-Sep-09, at 1:52 PM, Eliot Miranda wrote:
>
>  Hi All,
>>
>>    if I want to run through a complex test that tests a number of
>> combinations, some of which have failures, its convenient to wrap the test
>> in an exception handler for TestFailure and run the tests resuming on each
>> failure.  But I can't because TestFaiure isn't resumable.  Any good reason
>> why?
>>
>> e.g. I'm currently testing the generation of a divide/remainder routine
>> for the x86 where I'm enumerating over many combinations of register quads,
>> dividend, divisor, quotient, remainder, and I'd like to do the following to
>> count how many failures I'm getting with each tweak of the register juggling
>> code:
>>
>
> Well, SUnit wasn't designed to be used that way. Each test is supposed to
> have a binary result. Either it passes, or it doesn't. Sometimes the UI
> distinguishes between an assertion failing and an error, but that's sort of
> incidental. So TestFailure isn't resumable because we already have a result
> for the test: it failed. There's no need to continue executing the test,
> because further failures don't give any new information. In fact, further
> assertions are meaningless - we already know that *something* isn't as it
> should be. If further assertions fail, does that indicate additional
> problems, or the same one manifesting its self in different ways?
>
> The "proper" way to do this in SUnit would be to have a whole bunch of
> different tests that run the same code with different inputs. That's
> probably not practical.  A better way would be to write your own test
> harness. SUnit is great, but it's not the last word on testing, right?
>


Yes, but on the other hand, making TestFailure resumable does not in any way
break SUnit (AFAICS) and yet makes the framework more generally useful.  So
I propose, unless anyone can find a good reason, making it resumable.  Then
one doesn't have to replicate the bulk of the framework to do what I want,
something anyone testing operations with many combinations will likely find
useful.


>
> Colin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090912/68afb068/attachment.htm


More information about the Squeak-dev mailing list