builder/MyBuilder.pm

filter: Statementstmt 40.0% 16 / 40 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 55.5% 5 / 9 Podpod 0.0% 0 / 4 totaltotal 28.0% 21 / 75 CC 9 SCAR 29.0
CC
9
Cov
28%
new
30.0
ACTION_build
30.0
is_debug
2.0
CRAP 18.2
↑ Summary blib/lib/Compress/Zstd/CompressionDictionary.pm »
1 package builder::MyBuilder;
2 1 ▶use 5.008_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 parent 'Module::Build';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 my $LIBZSTD_DIR = 'ext/zstd/lib';
10  
11 0 ▶sub new {
Subroutine new: not called CC=5 SCAR=34.0
Pod undocumented
12 0 my ($class, %args) = @_;
13 0 my $self = $class->SUPER::new(%args);
14 0 ▶ if ($self->is_debug && !-d $LIBZSTD_DIR) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->is_debug and not -d $LIBZSTD_DIR) 0 0 0
Condition0%0/3
$self->is_debug and not -d $LIBZSTD_DIR
!ll&&!rl&&r
000
MC/DC0%0/2
$self->is_debug and not -d $LIBZSTD_DIR
$self->is_debug not -d $LIBZSTD_DIR
Truth table0%0/3
A and not(B)
A= $self->is_debugB= not -d $LIBZSTD_DIR
ABresult
0X0
100
111
15 0 $self->do_system('git', 'submodule', 'update', '--init');
16 }
17 0 my @extra_compiler_flags = (qw/
18 -Wall -Wextra -Wno-parentheses
19 -Wno-unused -Wno-unused-parameter
20 /, ('-I.', "-I$LIBZSTD_DIR"), ('-DZSTD_LEGACY_MULTITHREADED_API'));
21 0 my $ld = $self->config('ld');
22 0 ▶ if ($ld =~ s/^\s*env MACOSX_DEPLOYMENT_TARGET=[^\s]+ //) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ld =~ s/^\s*env MACOSX_DEPLOYMENT_TARGET=[^\s]+ //) 0 0 0
23 0 $self->config(ld => $ld);
24 }
25 0 ▶ if ($self->is_debug) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->is_debug) 0 0 0
26 0 $self->config(optimize => '-g -O0');
27 }
28 0 $self->extra_compiler_flags(@extra_compiler_flags);
29 0 $self->extra_linker_flags('-pthread', "$LIBZSTD_DIR/libzstd.a");
30 0 $self;
31 }
32  
33 0 ▶sub is_debug {
Subroutine is_debug: not called CC=1 SCAR=6.9
Pod undocumented
34 0 -d '.git';
35 }
36  
37 0 ▶sub ACTION_build {
Subroutine ACTION_build: not called CC=5 SCAR=34.0
Pod undocumented
38 0 my $self = shift;
39 0 ▶ $self->ACTION_ppport_h() unless -e 'ppport.h';
Branch: 1 branch
BranchTrueFalseTotal
unless -e "ppport.h" 0 0 0
40 0 ▶ unless (-f "$LIBZSTD_DIR/libzstd.a") {
Branch: 1 branch
BranchTrueFalseTotal
unless (-f "$LIBZSTD_DIR/libzstd.a") 0 0 0
41 0 local $ENV{CFLAGS} = '-DZSTD_MULTITHREAD -DZSTD_LEGACY_MULTITHREADED_API -O3 -fPIC';
42 0 my $make = 'make';
43 0 ▶ $make = 'gmake' if $^O =~ /bsd$/ && $^O !~ /gnukfreebsd$/;
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /bsd$/ and not $^O =~ /gnukfreebsd$/ 0 0 0
Condition0%0/3
$^O =~ /bsd$/ and not $^O =~ /gnukfreebsd$/
!ll&&!rl&&r
000
MC/DC0%0/2
$^O =~ /bsd$/ and not $^O =~ /gnukfreebsd$/
$^O =~ /bsd$/ not $^O =~ /gnukfreebsd$/
Truth table0%0/3
A and not(B)
A= $^O =~ /bsd$/B= not $^O =~ /gnukfreebsd$/
ABresult
0X0
100
111
44 0 $self->do_system($make => '-C', $LIBZSTD_DIR, 'libzstd.a');
45 }
46 0 $self->SUPER::ACTION_build();
47 }
48  
49 0 ▶sub ACTION_ppport_h {
Subroutine ACTION_ppport_h: not called CC=1 SCAR=6.9
Pod undocumented
50 0 require Devel::PPPort;
51 0 Devel::PPPort::WriteFile('ppport.h');
52 }
53  
54 1 1;
55 __END__
↑ Summary blib/lib/Compress/Zstd/CompressionDictionary.pm »