blib/lib/Check/Fork.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 10 / 10 Conditioncond 87.5% 7 / 8 MC/DCmcdc 60.0% 3 / 5 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 95.3% 61 / 64 CC 9 SCAR 18.2
CC
9
Cov
98%
check_fork
9.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.1
↑ Summary
1 package Check::Fork;
2  
3 5 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 5 our $ERROR_MESSAGE;
11 5 Readonly::Array our @EXPORT_OK => qw(check_fork $ERROR_MESSAGE);
12  
13 5 our $VERSION = 0.05;
14  
15 9 ▶sub check_fork {
Subroutine check_fork: called CC=9 SCAR=22.0
Pod documented
16 9 my ($config_hr, $os) = @_;
17  
18 9 ▶ $config_hr ||= \%Config;
Condition100%2/2
$config_hr ||= \%Check::Fork::Config
l!l
81
MC/DC100%1/1
$config_hr ||= \%Check::Fork::Config
$config_hr
Truth table100%2/2
A
A= $config_hr
Aresult
11
00
19 9 ▶ $os ||= $^O;
Condition66%2/3
$os ||= $^O
l!l&&r!l&&!r
810
MC/DC0%0/2
$os ||= $^O
$os $^O
Truth table66%2/3
A ||= B
A= $osB= $^O
ABresult
1X1
011
000
20  
21 9 ▶ if ($config_hr->{'d_fork'}) {
Branch: 3 branches
BranchTrueFalseTotal
if ($config_hr->{'d_fork'}) { } 2 7 9
elsif ($config_hr->{'d_pseudofork'}) { } 1 6 7
elsif ($os eq 'MSWin32' or $os eq 'NetWare') { } 5 1 6
22 2 return 1;
23 } elsif ($config_hr->{'d_pseudofork'}) {
24 1 return 1;
25 ▶ } elsif ($os eq 'MSWin32' || $os eq 'NetWare') {
Condition100%3/3
$os eq "MSWin32" or $os eq "NetWare"
l!l&&r!l&&!r
321
MC/DC100%2/2
$os eq "MSWin32" or $os eq "NetWare"
$os eq "MSWin32" $os eq "NetWare"
Truth table100%3/3
A or B
A= $os eq "MSWin32"B= $os eq "NetWare"
ABresult
1X1
011
000
26 5 ▶ if (! $config_hr->{'useithreads'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($config_hr->{"useithreads"}) 2 3 5
27 2 $ERROR_MESSAGE = "$os: No interpreter-based threading implementation.";
28 2 return 0;
29 }
30 3 ▶ if ($config_hr->{'ccflags'} !~ /-DPERL_IMPLICIT_SYS/) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($config_hr->{"ccflags"} =~ /-DPERL_IMPLICIT_SYS/) 1 2 3
31 1 $ERROR_MESSAGE = "$os: No PERL_IMPLICIT_SYS ccflags set.";
32 1 return 0;
33 }
34 2 return 1;
35 }
36 1 $ERROR_MESSAGE = 'No fork() routine available.';
37  
38 1 return 0;
39 }
40  
41 5 1;
42  
43 __END__
↑ Summary