1use strict; 2use warnings; 3 4use Test2::Util qw/CAN_REALLY_FORK/; 5use Test2::IPC; 6use Test2::API qw/context/; 7 8sub plan { 9 my $ctx = context(); 10 $ctx->plan(@_); 11 $ctx->release; 12} 13 14sub ok($;$) { 15 my ($bool, $name) = @_; 16 my $ctx = context(); 17 $ctx->ok($bool, $name); 18 $ctx->release; 19} 20 21plan(0, skip_all => 'System cannot fork') unless CAN_REALLY_FORK(); 22 23plan(6); 24 25for (1 .. 3) { 26 my $pid = fork; 27 die "Failed to fork" unless defined $pid; 28 next if $pid; 29 ok(1, "test 1 in pid $$"); 30 ok(1, "test 2 in pid $$"); 31 last; 32} 33 341; 35