| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
|
| 4 |
# Prevent Test2::Util from making 'CAN_FORK' a constant |
| 5 |
my $forks; |
| 6 |
BEGIN { |
| 7 |
require Test2::Util; |
| 8 |
local $SIG{__WARN__} = sub { 1 }; # no warnings is not sufficient on older perls |
| 9 |
*Test2::Util::CAN_FORK = sub { $forks }; |
| 10 |
} |
| 11 |
|
| 12 |
use Test2::Bundle::Extended -target => 'Test2::Require::Fork'; |
| 13 |
|
| 14 |
{ |
| 15 |
$forks = 0; |
| 16 |
is($CLASS->skip(), 'This test requires a perl capable of forking.', "will skip"); |
| 17 |
|
| 18 |
$forks = 1; |
| 19 |
is($CLASS->skip(), undef, "will not skip"); |
| 20 |
} |
| 21 |
|
| 22 |
done_testing; |