Perlito5

 view release on metacpan or  search on metacpan

lib/Perlito5X/Test2/API.pm  view on Meta::CPAN

package Test2::API;
use strict;
use warnings;

BEGIN {
    $ENV{TEST_ACTIVE} ||= 1;
    $ENV{TEST2_ACTIVE} = 1;
}

our $VERSION = '1.302073';


my $INST;
my $ENDING = 0;
sub test2_set_is_end { ($ENDING) = @_ ? @_ : (1) }
sub test2_get_is_end { $ENDING }

use Test2::API::Instance(\$INST);
# Set the exit status
END {
    test2_set_is_end(); # See gh #16
    $INST->set_exit();
}

# See gh #16
{
    no warnings;
    INIT { eval 'END { test2_set_is_end() }; 1' or die $@ }
}

BEGIN {
    no warnings 'once';
    if($] ge '5.014' || $ENV{T2_CHECK_DEPTH} || $Test2::API::DO_DEPTH_CHECK) {
        *DO_DEPTH_CHECK = sub() { 1 };
    }
    else {
        *DO_DEPTH_CHECK = sub() { 0 };
    }
}

use Test2::Util::Trace();

use Test2::Hub::Subtest();
use Test2::Hub::Interceptor();
use Test2::Hub::Interceptor::Terminator();

use Test2::Event::Ok();
use Test2::Event::Diag();
use Test2::Event::Note();
use Test2::Event::Plan();
use Test2::Event::Bail();
use Test2::Event::Exception();
use Test2::Event::Waiting();
use Test2::Event::Skip();
use Test2::Event::Subtest();

use Carp qw/carp croak confess longmess/;
use Scalar::Util qw/blessed weaken/;
use Test2::Util qw/get_tid/;

our @EXPORT_OK = qw{
    context release
    context_do
    no_context
    intercept
    run_subtest

    test2_init_done
    test2_load_done

    test2_set_is_end
    test2_get_is_end

    test2_pid
    test2_tid
    test2_stack
    test2_no_wait

    test2_add_callback_context_aquire
    test2_add_callback_context_acquire
    test2_add_callback_context_init
    test2_add_callback_context_release
    test2_add_callback_exit
    test2_add_callback_post_load
    test2_list_context_aquire_callbacks
    test2_list_context_acquire_callbacks
    test2_list_context_init_callbacks
    test2_list_context_release_callbacks
    test2_list_exit_callbacks
    test2_list_post_load_callbacks

    test2_ipc
    test2_ipc_drivers



( run in 3.322 seconds using v1.01-cache-2.11-cpan-a49fcb8fa48 )