in reply to Re^3: BAIL_OUT with older Test::More
in thread BAIL_OUT with older Test::More
Looking at the oldest source code on CPAN (Test-Harness 2.52) it might be as simple as die "Bail out!" when you want to bail.
The older versions of prove are backed by Test::Harness. prove calls Test::Harness::runtests which does nothing more than stuff each .t file into a strap (see Test::Harness::Straps), execute it, and add the results to its cumulative total.
Digging down into the source code, I notice that Test::Harness::Straps has a flag $self->{saw_bailout} that is set to 1 if the .t file's output stream (STDERR, I believe) contains a line matching: /^Bail out!\s*(.*)/i. Test::Harness checks for this flag and, if found, calls a bail out handler subroutine which... aborts the testing process.
If that doesn't work and you are very determined, I'd consider studying the source code of those two modules closely and writing a test runner script of your own that does what you want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: BAIL_OUT with older Test::More
by Anonymous Monk on Feb 15, 2011 at 19:08 UTC | |
by ELISHEVA (Prior) on Feb 15, 2011 at 19:50 UTC | |
by Anonymous Monk on Feb 15, 2011 at 20:10 UTC |