I am trying the whole day to find out the answer, but I didn't find anything. I wrote some tests using test::more (test1.t, test2.t, test3.t ...). and I wrote a main perl script (main.pl) that handles all the tests using TAP::Harness and print the output in a JUnit format using formatter_class => 'TAP::Formatter::JUnit. In my tests I use the BAIL_OUT function. The problem is that when a test is bailed out, the main script also exits and there is no output at all. If, for example test3.t bailed_out, I need to see the results for test1.t and test2.t. how can I do that?
I can't use exit or die instead of BAIL_OUT because I don't want the other tests to continue. (If test3.t was BAIL_OUT I don't want that test4.t will run.)
can someone please help me? I need to see the results for the tests that were running before the bailed out test.
Thanks.
According to the
Test::More
docs:So that explains why your suite aborts.
You might want to consider
die_on_fail
fromTest::Most
, orskip_all
, depending on the reason for the BAIL_OUT.EDIT: Looks like Test::Builder doesn't have any intention of printing out a summary when it exits on "catastrophic failure" according to the source code:
However, that
Bailed_Out
flag is only ever used to consider printing out summary diagnostics, and sinceTest::More
exposes the underlyingTest::Builder
object, you can probably just tweak theBAIL_OUT
subroutine and no set this flag. All untested, of course; YMMV.