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