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

NAME

Test::ForceExit - Ensure exit() is called by the end of a scope, force the issue.

DESCRIPTION

Sometimes you need to fork. Sometimes the forked process can throw an exception to exit. If you forked below an eval the exception will be cought and you suddenly have an unexpected process running amok. This module can be used to protect you from such issues.

SYNOPSIS

    eval {
        ...

        my $pid = fork;

        unless($pid) {
            require Test::Stream::ForceExit;
            my $force_exit = Test::Stream::ForceExit->new;

            thing_that_can_die();

            # We did not die, turn off the forced exit.
            $force_exit->done(1);

            # Do the exit we intend.
            exit 0;
        }

        ...
    }

SOURCE

The source code repository for Test::More can be found at http://github.com/Test-More/test-more/.

MAINTAINER

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright 2015 Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html