The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

TB2::DieOnFail - Stop the test on the first failure

SYNOPSIS

    use TB2::DieOnFail;
    use Test::Simple tests => 3;

    ok(1);
    ok(0);  # here it will stop
    ok(1);

DESCRIPTION

A demonstration of writing an EventHandler using handle_result to kill the test when an assert fails.

CAVEATS

While this will work with Test::Builder based modules (for example, Test::More still uses Test::Builder) it will kill the test before any diagnostics are output. Test::Builder2 based modules (such as Test::Simple) do not have this problem.

SEE ALSO

TB2::EventHandler