This would be easy to do in Test::Builder within &Test::Builder::ok by
making it call $Test->BAIL_OUT();
Then at least you would get it across all Test::* modules.
--
-Scott McWhirter- | -konobi-
On 9/7/07, Greg Sabino Mullane <[EMAIL PROTECTED]> wrote:
> > 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
>
>
>