2 # Tests for signal emulation
8 # only used for skip_all, the forking confuses test.pl
13 unless ($^O =~ /^MSWin/) {
14 skip_all('windows specific test');
21 skip_all("requires compilation with the fork emulation")
22 unless $Config{'d_pseudofork'};
26 # manual test counting because the forks confuse test.pl
29 # find a safe signal, the implementation shouldn't be doing anything
30 # funky with NUMdd signals
31 my ($sig) = grep /^NUM/, split ' ', $Config{sig_name};
33 # otherwise, hope CONT is safe
42 unless (defined $pid) {
44 not ok 1 # fork failed: $!
52 print "ok 1 # pseudo-forked\n";
53 sleep 2; # give the child a chance to setup
62 print "ok 2 # $sig signal handler called\n";
69 while (!$signalled && ++$count < 10) {
72 print "# signaled after $count loops\n";
73 print $! != 0 ? "not " : "", "ok 3 # \$! preserved\n";
74 print $^E != 0 ? "not " : "", "ok 4 # \$^E preserved\n"
75 or print STDERR "# \$^E = ", 0+$^E, "\n";