This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Convert t/op/die_except.t to test.pl, strict and warnings.
[perl5.git] / t / op / getppid.t
index cb069ff..a631610 100644 (file)
@@ -13,17 +13,11 @@ BEGIN {
 }
 
 use strict;
-use Config;
 
 BEGIN {
-    for my $syscall (qw(pipe fork waitpid getppid)) {
-       if (!$Config{"d_$syscall"}) {
-           print "1..0 # Skip: no $syscall\n";
-           exit;
-       }
-    }
     require './test.pl';
-    plan (7);
+    skip_all_without_config(qw(d_pipe d_fork d_waitpid d_getppid));
+    plan (8);
 }
 
 sub fork_and_retrieve {
@@ -40,7 +34,12 @@ sub fork_and_retrieve {
            unless my ($first, $second) = /^(\d+),(\d+)\z/;
        cmp_ok ($first, '>=', 1, "Parent of $which grandchild");
        cmp_ok ($second, '>=', 1, "New parent of orphaned $which grandchild");
-       isnt($first, $second, "Orphaned $which grandchild got a new parent");
+       SKIP: {
+           skip("Orphan processes are not reparented on QNX", 1)
+               if $^O eq 'nto';
+           isnt($first, $second,
+                 "Orphaned $which grandchild got a new parent");
+       }
        return $second;
     }
     else {
@@ -68,4 +67,8 @@ sub fork_and_retrieve {
 
 my $first = fork_and_retrieve("first");
 my $second = fork_and_retrieve("second");
-is ($first, $second, "Both orphaned grandchildren get the same new parent");
+SKIP: {
+    skip ("Orphan processes are not reparented on QNX", 1) if $^O eq 'nto';
+    is ($first, $second, "Both orphaned grandchildren get the same new parent");
+}
+isnt ($first, $$, "And that new parent isn't this process");