blib/lib/ExtUtils/CBuilder.pm

filter: Statementstmt 90.9% 30 / 33 Branchbran 50.0% 3 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 76.9% 40 / 52 CC 2 SCAR 3.2
CC
2
Cov
81%
__ANON__
2.0
os_type
2.0
BEGIN
1.0
CRAP 1.4
« _build/lib/MyModuleBuilder.pm ↑ Summary
1 package ExtUtils::CBuilder;
2  
3 2 ▶use File::Spec ();
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use File::Path ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use File::Basename ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use vars qw($VERSION @ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 $VERSION = '0.24_01';
9 2 $VERSION = eval $VERSION;
10  
11 # Okay, this is the brute-force method of finding out what kind of
12 # platform we're on. I don't know of a systematic way. These values
13 # came from the latest (bleadperl) perlport.pod.
14  
15 2 my %OSTYPES = qw(
16 aix Unix
17 bsdos Unix
18 dgux Unix
19 dynixptx Unix
20 freebsd Unix
21 linux Unix
22 hpux Unix
23 irix Unix
24 darwin Unix
25 machten Unix
26 next Unix
27 openbsd Unix
28 netbsd Unix
29 dec_osf Unix
30 svr4 Unix
31 svr5 Unix
32 sco_sv Unix
33 unicos Unix
34 unicosmk Unix
35 solaris Unix
36 sunos Unix
37 cygwin Unix
38 os2 Unix
39 gnu Unix
40 gnukfreebsd Unix
41 haiku Unix
42
43 dos Windows
44 MSWin32 Windows
45  
46 os390 EBCDIC
47 os400 EBCDIC
48 posix-bc EBCDIC
49 vmesa EBCDIC
50  
51 MacOS MacOS
52 VMS VMS
53 VOS VOS
54 riscos RiscOS
55 amigaos Amiga
56 mpeix MPEiX
57 );
58  
59 # We only use this once - don't waste a symbol table entry on it.
60 # More importantly, don't make it an inheritable method.
61 my $load = sub {
62 2 ▶ my $mod = shift;
Subroutine __ANON__: called CC=2 SCAR=7.0
63 2 ▶ eval "use $mod";
Subroutine BEGIN: called CC=1 SCAR=0.0
64 2 ▶ die $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 2 2
65 2 @ISA = ($mod);
66 2 };
67  
68 {
69 2 my @package = split /::/, __PACKAGE__;
70
71 2 ▶ if (grep {-e File::Spec->catfile($_, @package, 'Platform', $^O) . '.pm'} @INC) {
Branch: 2 branches
BranchTrueFalseTotal
if (grep {-e 'File::Spec'->catfile($_, @package, 'Platform', $^O) . '.pm';} @INC) { } 0 2 2
elsif (exists $OSTYPES{$^O} and grep {-e 'File::Spec'->catfile($_, @package, 'Platform', $OSTYPES{$^O}) . '.pm';} @INC) { } 2 0 2
72 0 $load->(__PACKAGE__ . "::Platform::$^O");
73
74 ▶ } elsif (exists $OSTYPES{$^O} and
Condition33%1/3
exists $OSTYPES{$^O} and grep {-e "File::Spec"->catfile($_, @package, "Platform", $OSTYPES{$^O}) . '.pm';} @INC
!ll&&!rl&&r
002
MC/DC0%0/2
exists $OSTYPES{$^O} and grep {-e "File::Spec"->catfile($_, @package, "Platform", $OSTYPES{$^O}) . '.pm';} @INC
exists $OSTYPES{$^O} grep {-e "File::Spec"->catfile($_, @package, "Platform", $OSTYPES{$^O}) . '.pm';} @INC
Truth table33%1/3
A and B
A= exists $OSTYPES{$^O}B= grep {-e "File::Spec"->catfile($_, @package, "Platform", $OSTYPES{$^O}) . '.pm';} @INC
ABresult
0X0
100
111
75 20 grep {-e File::Spec->catfile($_, @package, 'Platform', $OSTYPES{$^O}) . '.pm'} @INC) {
76 2 $load->(__PACKAGE__ . "::Platform::$OSTYPES{$^O}");
77
78 } else {
79 0 $load->(__PACKAGE__ . "::Base");
80 }
81 }
82  
83 0 ▶sub os_type { $OSTYPES{$^O} }
Subroutine os_type: not called CC=1 SCAR=6.9
Pod undocumented
84  
85 2 1;
86 __END__
« _build/lib/MyModuleBuilder.pm ↑ Summary