File: 06_fork.t

package info (click to toggle)
libtest-nowarnings-perl 1.06-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 156 kB
  • sloc: perl: 158; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 550 bytes parent folder | download
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
use strict;
use warnings;
use Test::More;

use Config;
BEGIN {
    my $can_fork = $Config{d_fork} || $Config{d_pseudofork} || (
        ($^O eq 'MSWin32' || $^O eq 'NetWare')
        and $Config{useithreads}
        and $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
    );
    if (!$can_fork) {
        plan skip_all => 'This system cannot fork';
    }
}

plan tests => 2;

use Test::NoWarnings;

pass("just testing");

# if it's working properly, only the parent will conduct a warnings test
my $pid = fork;
die "Forked failed, $!" unless defined $pid;