<br><br><div class="gmail_quote">On Sat, Sep 12, 2009 at 2:22 PM, Colin Putney <span dir="ltr"><<a href="mailto:cputney@wiresong.ca">cputney@wiresong.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On 10-Sep-09, at 1:52 PM, Eliot Miranda wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All,<br>
<br>
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?<br>
<br>
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:<br>
</blockquote>
<br></div>
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?<br>
<br>
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?<br>
</blockquote><div><br></div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">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.</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "></span> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888">
<br>
Colin<br>
</font></blockquote></div><br>