summaryrefslogtreecommitdiff
path: root/cpan/Test-Simple/t/regression/skip_reason_object_ipc.t
blob: 489a65dd206b9cf179bbfd6db09adcba2fd2e151 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use Test2::Tools::Tiny;
use strict;
use warnings;

use Test2::IPC;
use Test::Builder;
use Test2::Util qw/CAN_REALLY_FORK/;

skip_all 'No IPC' unless CAN_REALLY_FORK;

ok(1, "pre-test");

my $pid = fork;
die "Could not fork: $!" unless defined $pid;

if ($pid) {
   my $ret = waitpid($pid, 0);
   is($ret, $pid, "Got correct pid");
   is($?, 0, "Exited without issue");
}
else {
    ok(1, "A test");

    my $obj = bless({foo => \*STDOUT}, 'FOO');

    Test::Builder->new->skip($obj, $obj);

    ok(1, "Another Test");

    exit 0;
}

done_testing;