--- Matisse Enzer <[EMAIL PROTECTED]> wrote:

> 
> On Jan 11, 2008, at 8:04 AM, Ovid wrote:
> >
> > Well, your feature is slightly different in that it calls BAIL_OUT
> on
> > failure and halts the entire test suite.
> 
> That's a behavior I have wanted - for large test suites being used  
> during development for example. I just want to stop the whole test
> run at the very first failure.

OK, but this is global behavior and you *don't* want to specify this in
every single test program.  We have 228 test programs and later, if we
wanted to remove this, we'd have 228 programs to edit because this is
global failure.  You'd want something like this:

  BAIL_OUT_ON_FAILURE=1 prove -r t/

And then in the custom Test::More's BEGIN block:

  if ( $ENV{BAIL_OUT_ON_FAILURE} ) {
      wrap 'Test::Builder::ok', post => sub {
          if (![ $_[0]->summary ]->[-1]) {
              Test::More::BAIL_OUT( "Test failed.  Halting" );
          }
      };
  }

You'd probably also have to modify the 'die on failure' behavior to not
come behind and rewrap that.

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Perl and CGI  - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog     - http://use.perl.org/~Ovid/journal/

Reply via email to