Michael G Schwern wrote:
On Mon, Jul 18, 2005 at 09:42:06AM -0400, Brett Sanger wrote:
There are some tests that I would love to have abort as soon as they
fail. (If step 3 failed, then steps 4 and 5 are places I don't want to
go) Is there a way to make prove do this? I skimmed the
Test::Builder docs, in case I was going to have to roll my own
prove-like tool, and didn't see an obvious call there either.
If you mean to abort the running of all further tests and test files, the
function you want is BAIL_OUT() which was added to Test::More in 0.60_01.
Its a very simple function and you can read about it here.
http://search.cpan.org/dist/Test-Harness/lib/Test/Harness/TAP.pod#Bail_out!
And if you're using an earlier version of Test::More that doesn't have
BAIL_OUT() then you can just print the magic string directly in your test.
Something like:
use_ok('Foo::Bar') or print "Bail out! Couldn't load Foo::Bar";
N