This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
svleak.t: Enable syntax error tests under -Dmad
[perl5.git] / t / op / sigsystem.t
index c20d9d2..ddfebf9 100644 (file)
@@ -2,6 +2,8 @@
 
 BEGIN {
       require './test.pl';
+      skip_all_if_miniperl();
+      skip_all_without_config(qw(d_fork));
 }
 
 use strict;
@@ -11,10 +13,17 @@ use Data::Dumper;
 plan tests => 4;
 
 SKIP: {
-    skip 'Platform doesn\'t support SIGCHLD', 4 if is_miniperl() or not exists $SIG{CHLD};
+    skip 'Platform doesn\'t support SIGCHLD', 4 if not exists $SIG{CHLD};
     require POSIX;
     require Time::HiRes;
 
+    my @pids;
+    $SIG{CHLD} = sub {
+       while ((my $child = waitpid(-1, POSIX::WNOHANG())) > 0) {
+           note "Reaped: $child";
+           push @pids, $child;
+       }
+    };
     my $pid = fork // die "Can't fork: $!";
     unless ($pid) {
        note("Child PID: $$");
@@ -24,14 +33,6 @@ SKIP: {
 
     test_system('without reaper');
 
-    my @pids;
-    $SIG{CHLD} = sub {
-       while ((my $child = waitpid(-1, POSIX::WNOHANG())) > 0) {
-           note "Reaped: $child";
-           push @pids, $child;
-       }
-    };
-
     test_system('with reaper');
 
     note("Waiting briefly for SIGCHLD...");