blib/lib/Win32/Getppid.pm

filter: Statementstmt 79.1% 19 / 24 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 73.6% 28 / 38 CC 2 SCAR 4.5
CC
2
Cov
72%
BEGIN
2.5
__ANON__
2.0
BEGIN
1.0
CRAP 1.6
↑ Summary
1 package Win32::Getppid;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use 5.008001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base qw( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶BEGIN {
Subroutine BEGIN: called CC=2 SCAR=9.2
9  
10 # ABSTRACT: Implementation of getppid() for windows
11 1 our $VERSION = '0.06'; # VERSION
12  
13 1 ▶ if($^O =~ /^(cygwin|MSWin32|msys)$/)
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /^(cygwin|MSWin32|msys)$/) 0 1 1
14 {
15 0 require XSLoader;
16 0 XSLoader::load('Win32::Getppid', $Win32::Getppid::VERSION);
17 }
18  
19 }
20  
21 1 our @EXPORT;
22 1 our @EXPORT_OK = qw( getppid );
23  
24 1 ▶if($^O eq 'MSWin32')
Branch: 2 branches
BranchTrueFalseTotal
if ($^O eq 'MSWin32') { } 0 1 1
elsif ($^O =~ /^(cygwin|msys)$/) { } 0 1 1
25 {
26 0 @EXPORT = qw( getppid );
27 }
28 elsif($^O =~ /^(cygwin|msys)$/)
29 {
30 # Allow import, but not by default
31 # on cygwin/msys
32 }
33 else
34 {
35 1 ▶ if($] >= 5.016)
Branch: 1 branch
BranchTrueFalseTotal
if ($] >= 5.016) { } 1 0 1
36 {
37 1 *getppid = \&CORE::getppid;
38 }
39 else
40 {
41 0 ▶ *getppid = sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
42 package
43 Win32::Getppid::sandbox;
44 0 getppid();
45 0 };
46 }
47 }
48  
49  
50 1 1;
51  
52 __END__
↑ Summary