Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Bailing out from Test::More after 'some' failures

by exodist (Monk)
on May 16, 2019 at 21:20 UTC ( [id://11100128]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Bailing out from Test::More after 'some' failures
in thread Bailing out from Test::More after 'some' failures

Most of the time means that any tool written with Test2 in mind, or directly on Test2 will work as expected, this should include most methods on Test::Builder itself. However cpan tools written against old Test::Builder that do not use Test2's 'Context' system may still call $tb->ok and $tb->diag separately, in which case the diag will still be lost.

In Test2 you would do this:
sub mytool { my $ctx = context(); $ctx->ok(...); $ctx->diag(...); $ctx->release; # This is where the bail-on-fail is triggered }
The TB version:
sub mytool { $tb->ok(...); # BailOnFail is triggered here $tb->diag(...); # Lost }
$tb methods do acquire context's, but each of those methods has to acquire it's own. That said the diagnostics TB itself generates in a failed-ok (like line number) will make the output, it is just extra diags are lost.

That is unfortunately a fundamental, and not-fixable limitation of Test::Builder that Test2 avoided with the context system. Test2 was specifically designed to overcome this and many other TB limitations.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11100128]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-19 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found