alienfile

filter: Statementstmt 40.3% 21 / 52 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 22 MC/DCmcdc 0.0% 0 / 12 Subroutinesub 55.5% 5 / 9 Podpod n/a totaltotal 24.3% 26 / 107 CC 17 SCAR 37.3
CC
17
Cov
24%
_cmake_generator_args
90.0
__ANON__
30.0
_cmake_path
12.0
CRAP 41.5
↑ Summary blib/lib/Alien/nghttp3/Install/Files.pm »
1 1 ▶use alienfile 2.84;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 1 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use File::Spec ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use IPC::Cmd qw(can_run);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 my $minimum_version = '1.18.0';
8  
9 0 ▶sub _cmake_path {
Subroutine _cmake_path: not called CC=3 SCAR=24.8
10 0 my ($path) = @_;
11  
12 0 ▶ return $path if !defined $path;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $path 0 0 0
13  
14 0 ▶ $path =~ s{\\}{/}g if $^O eq 'MSWin32';
Branch: 1 branch
BranchTrueFalseTotal
if $^O eq "MSWin32" 0 0 0
15  
16 0 return $path;
17 }
18  
19 0 ▶sub _cmake_generator_args {
Subroutine _cmake_generator_args: not called CC=9 SCAR=45.0
20 0 ▶ return () if $^O ne 'MSWin32';
Branch: 1 branch
BranchTrueFalseTotal
if $^O ne "MSWin32" 0 0 0
21  
22 0 ▶ my $cc = lc($Config{cc} || '');
Condition0%0/2
$Alien::Build::Auto::X0::Alienfile::Config{'cc'} || ''
l!l
00
MC/DC0%0/1
$Alien::Build::Auto::X0::Alienfile::Config{'cc'} || ''
$Alien::Build::Auto::X0::Alienfile::Config{'cc'}
Truth table0%0/2
A
A= $Alien::Build::Auto::X0::Alienfile::Config{'cc'}
Aresult
11
00
23 0 ▶ return () if $cc !~ /(?:gcc|mingw)/;
Branch: 1 branch
BranchTrueFalseTotal
unless $cc =~ /(?:gcc|mingw)/ 0 0 0
24  
25 0 my @args = ('-G', 'MinGW Makefiles');
26 0 ▶ my $make = can_run($Config{make} || '')
Condition0%0/8
can_run($Alien::Build::Auto::X0::Alienfile::Config{'make'} || '') || can_run('mingw32-make') || can_run('gmake')
l!l&&r!l&&!r
000
can_run($Alien::Build::Auto::X0::Alienfile::Config{"make"} || "") or can_run("mingw32-make")
l!l&&r!l&&!r
000
$Alien::Build::Auto::X0::Alienfile::Config{'make'} || ''
l!l
00
MC/DC0%0/3
can_run($Alien::Build::Auto::X0::Alienfile::Config{'make'} || '') || can_run('mingw32-make') || can_run('gmake')
can_run($Alien::Build::Auto::X0::Alienfile::Config{"make"} || "") can_run("mingw32-make") can_run('gmake')
MC/DC0%0/1
$Alien::Build::Auto::X0::Alienfile::Config{'make'} || ''
$Alien::Build::Auto::X0::Alienfile::Config{'make'}
Truth table0%0/4
A or B || C
A= can_run($Alien::Build::Auto::X0::Alienfile::Config{"make"} || "")B= can_run("mingw32-make")C= can_run('gmake')
ABCresult
1XX1
01X1
0011
0000
Truth table0%0/2
A
A= $Alien::Build::Auto::X0::Alienfile::Config{'make'}
Aresult
11
00
27 || can_run('mingw32-make')
28 || can_run('gmake');
29  
30 0 ▶ if (defined($make) && length($make)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $make and length $make) 0 0 0
Condition0%0/3
defined $make and length $make
!ll&&!rl&&r
000
MC/DC0%0/2
defined $make and length $make
defined $make length $make
Truth table0%0/3
A and B
A= defined $makeB= length $make
ABresult
0X0
100
111
31 0 push @args,
32 '-DCMAKE_MAKE_PROGRAM=' . _cmake_path($make);
33 }
34  
35 0 return @args;
36 }
37  
38 1 plugin 'PkgConfig' => (
39 pkg_name => 'libnghttp3',
40 atleast_version => $minimum_version,
41 );
42  
43 1 ▶share {
Subroutine __ANON__: called CC=1 SCAR=4.6
44 1 requires 'Alien::cmake3' => '0.10';
45  
46 1 start_url 'vendor/nghttp3-1.18.0/';
47 1 plugin 'Fetch::LocalDir';
48 1 plugin 'Extract::Directory';
49  
50 0 ▶ build sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
51 0 my ($build) = @_;
52  
53 0 require Alien::cmake3;
54  
55 0 my $prefix = $build->install_prop->{prefix};
56 0 my $cmake = Alien::cmake3->exe;
57 0 ▶ my $path_sep = $Config{path_sep} || ':';
Condition0%0/2
$Alien::Build::Auto::X0::Alienfile::Config{'path_sep'} || ':'
l!l
00
MC/DC0%0/1
$Alien::Build::Auto::X0::Alienfile::Config{'path_sep'} || ':'
$Alien::Build::Auto::X0::Alienfile::Config{'path_sep'}
Truth table0%0/2
A
A= $Alien::Build::Auto::X0::Alienfile::Config{'path_sep'}
Aresult
11
00
58 0 my $build_dir = File::Spec->catdir(
59 File::Spec->curdir,
60 '.alien-nghttp3-build',
61 );
62  
63 local $ENV{PATH} = join(
64 $path_sep,
65 Alien::cmake3->bin_dir,
66 0 ▶ $ENV{PATH} || (),
Condition0%0/3
$ENV{'PATH'} || ()
l!l&&r!l&&!r
000
MC/DC0%0/2
$ENV{'PATH'} || ()
$ENV{'PATH'} ()
Truth table0%0/3
A || B
A= $ENV{'PATH'}B= ()
ABresult
1X1
011
000
67 );
68  
69 0 my @generator_args = _cmake_generator_args();
70  
71 0 $build->system(
72 $cmake,
73 '-S', File::Spec->curdir,
74 '-B', $build_dir,
75 @generator_args,
76 "-DCMAKE_INSTALL_PREFIX=$prefix",
77 '-DCMAKE_BUILD_TYPE=Release',
78 '-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
79 '-DENABLE_LIB_ONLY=ON',
80 '-DENABLE_SHARED_LIB=OFF',
81 '-DENABLE_STATIC_LIB=ON',
82 '-DBUILD_TESTING=OFF',
83 );
84  
85 0 $build->system(
86 $cmake,
87 '--build', $build_dir,
88 '--config', 'Release',
89 );
90  
91 0 $build->system(
92 $cmake,
93 '--build', $build_dir,
94 '--target', 'install',
95 '--config', 'Release',
96 );
97  
98 0 return 1;
99 1 };
100  
101 0 ▶ after 'gather' => sub {
Subroutine __ANON__: not called CC=5 SCAR=34.0
102 0 my ($build) = @_;
103  
104 my $compiler_type
105 0 ▶ = $build->meta_prop->{platform}->{compiler_type} || '';
Condition0%0/2
$build->meta_prop->{'platform'}{'compiler_type'} || ''
l!l
00
MC/DC0%0/1
$build->meta_prop->{'platform'}{'compiler_type'} || ''
$build->meta_prop->{'platform'}{'compiler_type'}
Truth table0%0/2
A
A= $build->meta_prop->{'platform'}{'compiler_type'}
Aresult
11
00
106 0 ▶ my $define = $compiler_type eq 'microsoft'
Branch: 1 branch
BranchTrueFalseTotal
$compiler_type eq 'microsoft' ? : 0 0 0
107 ? '/DNGHTTP3_STATICLIB'
108 : '-DNGHTTP3_STATICLIB';
109  
110 0 for my $key (qw(cflags cflags_static)) {
111 0 ▶ my $value = $build->runtime_prop->{$key} || '';
Condition0%0/2
$build->runtime_prop->{$key} || ''
l!l
00
MC/DC0%0/1
$build->runtime_prop->{$key} || ''
$build->runtime_prop->{$key}
Truth table0%0/2
A
A= $build->runtime_prop->{$key}
Aresult
11
00
112 $build->runtime_prop->{$key}
113 0 = join ' ', grep { length } $value, $define;
114 }
115 1 };
116 1 };
↑ Summary blib/lib/Alien/nghttp3/Install/Files.pm »