_build/lib/MyModuleBuilder.pm

filter: Statementstmt 65.4% 36 / 55 Branchbran 30.0% 6 / 20 Conditioncond 14.2% 1 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 66.6% 6 / 9 Podpod 0.0% 0 / 3 totaltotal 50.0% 49 / 98 CC 11 SCAR 22.8
CC
11
Cov
52%
compile_c
23.9
__ANON__
6.0
__ANON__
6.0
CRAP 9.8
↑ Summary blib/lib/Params/Classify.pm »
1 package MyModuleBuilder;
2 1 ▶use Module::Build;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 our @ISA = qw(Module::Build);
4  
5 1 ▶ unless(__PACKAGE__->can("cbuilder")) {
Branch: 1 branch
BranchTrueFalseTotal
unless (__PACKAGE__->can("cbuilder")) 0 1 1
6 0 ▶ *cbuilder = sub { $_[0]->_cbuilder or die "no C support" };
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->_cbuilder or die "no C support" 0 0 0
7 }
8 1 ▶ unless(__PACKAGE__->can("have_c_compiler")) {
Branch: 1 branch
BranchTrueFalseTotal
unless (__PACKAGE__->can("have_c_compiler")) 0 1 1
9 *have_c_compiler = sub {
10 0 ▶ my $cb = eval { $_[0]->cbuilder };
Subroutine __ANON__: not called CC=2 SCAR=17.9
11 0 ▶ return $cb && $cb->have_compiler;
Condition0%0/3
$cb && $cb->have_compiler
!ll&&!rl&&r
000
MC/DC0%0/2
$cb && $cb->have_compiler
$cb $cb->have_compiler
Truth table0%0/3
A && B
A= $cbB= $cb->have_compiler
ABresult
0X0
100
111
12 0 };
13 }
14 1 ▶ if($Module::Build::VERSION < 0.33) {
Branch: 1 branch
BranchTrueFalseTotal
if ($Module::Build::VERSION < "0.33") 0 1 1
15 # Older versions of Module::Build have a bug where if the
16 # cbuilder object is used at Build.PL time (which it will
17 # be for this distribution due to the logic in
18 # ->find_xs_files) then that object can be dumped to the
19 # build_params file, and then at Build time it will
20 # attempt to use the dumped blessed object without loading
21 # the ExtUtils::CBuilder class that is needed to make it
22 # work.
23 *write_config = sub {
24 0 ▶ delete $_[0]->{properties}->{_cbuilder};
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 0 return $_[0]->SUPER::write_config;
26 0 };
27 }
28 sub find_xs_files {
29 1 ▶ my($self) = @_;
Subroutine find_xs_files: called CC=2 SCAR=7.1
Pod undocumented
30 1 ▶ return {} unless $self->have_c_compiler;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->have_c_compiler 0 1 1
31 1 return $self->SUPER::find_xs_files;
32 }
33 sub compile_c {
34 1 ▶ my($self, $file, %args) = @_;
Subroutine compile_c: called CC=6 SCAR=31.7
Pod undocumented
35 1 my $cc0_h =
36 $self->localize_file_path("lib/Params/callchecker0.h");
37 1 ▶ unless(-f $cc0_h) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-f $cc0_h) 0 1 1
38 0 ▶ my $content = eval {
Condition0%0/2
eval { do { local $SIG{'__DIE__'}; require Devel::CallChecker; 'Devel::CallChecker'->VERSION(0.003); &Devel::CallChecker::callchecker0_h() } } || ''
l!l
00
MC/DC0%0/1
eval { do { local $SIG{'__DIE__'}; require Devel::CallChecker; 'Devel::CallChecker'->VERSION(0.003); &Devel::CallChecker::callchecker0_h() } } || ''
eval { do { local $SIG{'__DIE__'}; require Devel::CallChecker; 'Devel::CallChecker'->VERSION(0.003); &Devel::CallChecker::callchecker0_h() } }
Truth table0%0/2
A
A= eval { do { local $SIG{'__DIE__'}; require Devel::CallChecker; 'Devel::CallChecker'->VERSION(0.003); &Devel::CallChecker::callchecker0_h() } }
Aresult
11
00
39 0 local $SIG{__DIE__};
40 0 require Devel::CallChecker;
41 0 Devel::CallChecker->VERSION(0.003);
42 0 &Devel::CallChecker::callchecker0_h();
43 } || "";
44 0 $self->add_to_cleanup($cc0_h);
45 0 require IO::File;
46 0 ▶ my $fh = IO::File->new($cc0_h, "w") or die $!;
Branch: 1 branch
BranchTrueFalseTotal
my $fh = "IO::File"->new($cc0_h, "w") or die $! 0 0 0
47 0 ▶ $fh->printflush($content) or die $!;
Branch: 1 branch
BranchTrueFalseTotal
$fh->printflush($content) or die $! 0 0 0
48 0 ▶ $fh->close or die $!;
Branch: 1 branch
BranchTrueFalseTotal
$fh->close or die $! 0 0 0
49 }
50 1 return $self->SUPER::compile_c($file, %args);
51 }
52 sub link_c {
53 1 ▶ no strict "refs";
Subroutine BEGIN: called CC=1 SCAR=0.0
54 1 ▶ my($self, $spec) = @_;
Subroutine link_c: called CC=1 SCAR=0.0
Pod undocumented
55 1 my $cb = $self->cbuilder;
56 1 my $cbclass = ref($cb);
57 1 my $orig_cb_link = $cb->can("link");
58 1 local *{"${cbclass}::link"} = sub {
59 1 ▶ my($self, %args) = @_;
Subroutine __ANON__: called CC=3 SCAR=11.1
60 1 ▶ if($args{module_name} eq "Params::Classify") {
Branch: 1 branch
BranchTrueFalseTotal
if ($args{"module_name"} eq "Params::Classify") 1 0 1
61 1 ▶ my $cc_linkables = eval {
Condition50%1/2
eval { do { local $SIG{'__DIE__'}; require Devel::CallChecker; 'Devel::CallChecker'->VERSION(0.003); [&Devel::CallChecker::callchecker_linkable] } } || []
l!l
10
MC/DC0%0/1
eval { do { local $SIG{'__DIE__'}; require Devel::CallChecker; 'Devel::CallChecker'->VERSION(0.003); [&Devel::CallChecker::callchecker_linkable] } } || []
eval { do { local $SIG{'__DIE__'}; require Devel::CallChecker; 'Devel::CallChecker'->VERSION(0.003); [&Devel::CallChecker::callchecker_linkable] } }
Truth table50%1/2
A
A= eval { do { local $SIG{'__DIE__'}; require Devel::CallChecker; 'Devel::CallChecker'->VERSION(0.003); [&Devel::CallChecker::callchecker_linkable] } }
Aresult
11
00
62 1 local $SIG{__DIE__};
63 1 require Devel::CallChecker;
64 1 Devel::CallChecker->VERSION(0.003);
65 1 [&Devel::CallChecker::callchecker_linkable];
66 } || [];
67 $args{objects} = [
68 1 @{$args{objects}},
69 @$cc_linkables,
70 ];
71 }
72 1 @_ = ($self, %args);
73 1 goto &$orig_cb_link;
74 1 };
75 1 $self->SUPER::link_c($spec);
76 }
77  
78 1 1;
↑ Summary blib/lib/Params/Classify.pm »