1use Test2::Tools::Tiny; 2use strict; 3use warnings; 4 5use Test2::IPC; 6use Test2::Util qw/CAN_THREAD CAN_REALLY_FORK/; 7 8skip_all 'No IPC' unless CAN_REALLY_FORK || CAN_THREAD; 9 10if (CAN_REALLY_FORK) { 11 my $pid = fork; 12 die "Failed to fork: $!" unless defined $pid; 13 if ($pid) { 14 waitpid($pid, 0) 15 } 16 else { 17 ok(1, "Pass fork"); 18 exit 0; 19 } 20} 21 22if (CAN_THREAD) { 23 require threads; 24 my $thread = threads->create( 25 sub { 26 ok(1, "Pass thread"); 27 } 28 ); 29 30 $thread->join; 31} 32 33done_testing; 34