|
our $VERSION = '0.11' ;
use 5.008000;
my $STORE ;
BEGIN {
$STORE = Test::SharedFork::Store->new(
cb => sub {
my $store = shift ;
tie __PACKAGE__->builder->{Curr_Test}, 'Test::SharedFork::Scalar' , 0, $store ;
tie @{ __PACKAGE__->builder->{Test_Results} }, 'Test::SharedFork::Array' , $store ;
}
);
no strict 'refs' ;
no warnings 'redefine' ;
for my $name ( qw/ok skip todo_skip current_test/ ) {
my $orig = *{ "Test::Builder::${name}" }{CODE};
*{ "Test::Builder::${name}" } = sub {
local $Test::Builder::Level += 4;
my @args = @_ ;
$STORE ->lock_cb( sub {
$orig ->( @args );
});
};
};
}
{
sub parent { }
sub child { }
sub fork { fork () }
}
1;
|