perl - handle tests using TAP::Harness, how to print output when test exits -


i trying whole day find out answer, didn't find anything. wrote tests using test::more (test1.t, test2.t, test3.t ...). , wrote main perl script (main.pl) handles tests using tap::harness , print output in junit format using formatter_class => 'tap::formatter::junit. in tests use bail_out function. problem when test bailed out, main script exits , there no output @ all. if, example test3.t bailed_out, need see results test1.t , test2.t. how can that?

i can't use exit or die instead of bail_out because don't want other tests continue. (if test3.t bail_out don't want test4.t run.)

can please me? need see results tests running before bailed out test.

thanks.

according test::more docs:

bail_out($reason);

indicates harness things going badly testing should terminate.
includes running of additional test scripts.

so explains why suite aborts.

you might want consider die_on_fail test::most, or skip_all, depending on reason bail_out.

edit: looks test::builder doesn't have intention of printing out summary when exits on "catastrophic failure" according source code:

sub bail_out {     my( $self, $reason ) = @_;      $self->{bailed_out} = 1;     $self->_print("bail out!  $reason");     exit 255; }  # don't ending if bailed out. if( $self->{bailed_out} ) {     $self->is_passing(0);     return; } 

however, bailed_out flag ever used consider printing out summary diagnostics, , since test::more exposes underlying test::builder object, can tweak bail_out subroutine , no set flag. untested, of course; ymmv.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -