develooper Front page | perl.qa | Postings from January 2008

Re: Dude, where's my diagnostics? (Re: Halting on first test failure)

Thread Previous | Thread Next
From:
Ovid
Date:
January 12, 2008 05:39
Subject:
Re: Dude, where's my diagnostics? (Re: Halting on first test failure)
Message ID:
715394.78875.qm@web60819.mail.yahoo.com
--- Michael G Schwern <schwern@pobox.com> wrote:

> PS  Couldn't you have the TAP harness kill the test process on first
> failure?

I then have even less control over the diagnostics than I would if
Test::Builder handled this responsibility.

It's also an improper separation of concerns.  Test::Builder produces
the output and the harness interprets the output.  BAIL OUT isn't an
exception since that's telling the harness to stop running more tests
but it's Test::Builder which handles the termination:

  sub BAIL_OUT {
     my($self, $reason) = @_;

     $self->{Bailed_Out} = 1;
     $self->_print("Bail out!  $reason");
     exit 255;
 }

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/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About