4 # Note that because fork loses test count we do not use Test::More
8 BEGIN { print "1..8\n"; }
14 my $file = File::Temp->new(CLEANUP=>1);
16 myok( 1, -f $file->filename, "OO File exists" );
19 for my $i (1 .. $children) {
21 die "Can't fork: $!" unless defined $pid;
26 # in a child we can't keep the count properly so we do it manually
27 # make sure that child 1 dies first
29 my $time = (($i-1) * 5) +int(rand(5));
30 print "# child $i sleeping for $time seconds\n";
33 myok( $count, -f $file->filename(), "OO file present in child $i" );
34 print "# child $i exiting\n";
46 myok( 4, -f $file->filename(), "OO File exists in parent" );
50 my ($fh, $filename) = File::Temp::tempfile( CLEANUP => 1 );
52 myok( 5, -f $filename, "non-OO File exists" );
55 for my $i (1 .. $children) {
57 die "Can't fork: $!" unless defined $pid;
63 my $time = (($i-1) * 5) +int(rand(5));
64 print "# child $i sleeping for $time seconds\n";
67 myok( $count, -f $filename, "non-OO File present in child $i" );
68 print "# child $i exiting\n";
77 myok(8, -f $filename, "non-OO File exists in parent" );
80 # Local ok sub handles explicit number
82 my ($count, $test, $msg) = @_;
85 print "ok $count - $msg\n";
87 print "not ok $count - $msg\n";