> I'd like Test::* to completely bailout on the first 
> is/ok/whatever to fail.  I just can't seem to find a 
> canonical way to do this.  but someone here knows, I'm sure :)

I don't know about canonical, but here's how I do it. I've 
got a test suite that takes many minutes to complete, so 
stopping on the first failure is definitely needed.

First, I set up a early ENV toggle:

## Sometimes, we want to stop as soon as we see an error
my $bail_on_error = $ENV{BUCARDO_TESTBAIL} || 0;

Then, I override the standard Test::More methods:

## no critic
{
  no warnings; ## Yes, we know they are being redefined!
  sub is_deeply {
    return if Test::More::is_deeply(@_);
    $bail_on_error and BAIL_OUT "Stopping on failed 'is_deeply' test";
  } ## end of is_deeply
  sub like {
    return if Test::More::like($_[0],$_[1],$_[2]);
    $bail_on_error and BAIL_OUT "Stopping on failed 'like' test";
  } ## end of like

  ## etc. for all test methods you are using
}
## use critic

Sure would be nice if this was a Test::More option.


-- 
Greg Sabino Mullane [EMAIL PROTECTED]
End Point Corporation 610-983-9073

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to