On Wed, Dec 21, 2005 at 01:34:39PM -0800, Joe McMahon wrote:

> print <<EOS;
> 1..1
> not ok 1 ... failed once
> not ok 1 ... failed twice
> ok 1 ... worked
> EOS

> Obviously, you can wrap up the actual test in a retry loop/function,  
> but this doesn't match up with the simplicity of Test::More and related  
> testing methods. It seems like the only way to address this is to  
> subclass Test::Builder (or write a new class) that buffers up the test  
> output and only outputs it after tests are "committed" (i.e., "I've run  
> this N times and am sticking with the final result").
> 
> Or am I stretching TAP too far? Thoughts?

To me the cleanest way to do this ought to be to subclass Test::Builder
to give the behaviour that it only prints the last result line for a given
test number when it sees the first result line for the next test number
appears. That would mean that the body of your test script would still call
all the regular ok/is/like etc functions without changing them, and your
test script still outputs regular TAP where each numbered test reports
exactly once.

Nicholas Clark

Reply via email to