Test2::...ilOnFail(3)
π Test2::Plugin::BailOnFail
okay so bestie, this is a page from the User Contributed Perl Documentation and it's literally the shortest little glow-up you've ever read. It's called Test2::Plugin::BailOnFail and it does exactly one thing, but it does it iconically.
β¨ NAME β¨
Test2::Plugin::BailOnFail β Automatically bail out of testing on the first test failure.
π DESCRIPTION π
So here's the tea: this module will issue a bailout event after the first test failure. That's it, that's the whole vibe.
This will prevent your tests from continuing. No more running 400 more tests after the one that already ate it β like, what's the point, honestly? π
The important little detail (and this is the part you gotta remember, no cap): the bailout runs when the context is released. Translating from nerd: it will run when the test function you are using, such as ok(), returns. That's on purpose, bestie β it gives the tools the chance to output any extra diagnostics they may need before everything shuts down. Giving the diagnostics their main character moment before the bailout. π«Ά
π SYNOPSIS π
use Test2::V0;
use Test2::Plugin::BailOnFail;
ok(1, "pass");
ok(0, "fail");
ok(1, "Will not run");
Notice how that last ok(1, "Will not run") justβ¦ doesn't run? Yeah. That's the whole point. The ok(0, "fail") happens, the bailout kicks in when it's done, and the third one never gets its turn. It's giving cancelled. π
π SOURCE π
The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/.
Go be nosy, it's encouraged. π
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>
πΈ AUTHORS πΈ
- Chad Granum
<exodist@cpan.org>
(yes it's the same person in both, and yes that's iconic of him, we love a consistent legend β¨)
π COPYRIGHT π
Copyright Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
π fr fr that's the entire page, it's tiny but mighty, and now you know it. go forth and bail on your first failure like a queen. π¦
perl v5.42.0 Β· 2025-07-28 β mwah, that's the version and date, catch you on the next page bestie ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Test-Simple 1.302214-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms