Compiler/Unixy.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 8 / 8 Conditioncond 63.6% 7 / 11 MC/DCmcdc 40.0% 2 / 5 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 87.1% 54 / 62 CC 10 SCAR 15.4
CC
10
Cov
92%
compile_flags
6.0
_init
5.3
BEGIN
1.0
CRAP 4.7
« Linker/ELF/Any.pm ↑ Summary Linker/COFF.pm »
1 package ExtUtils::Builder::Compiler::Unixy;
2 3 $ExtUtils::Builder::Compiler::Unixy::VERSION = '0.038';
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use parent 'ExtUtils::Builder::Compiler';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 10 ▶sub _init {
Subroutine _init: called CC=5 SCAR=16.6
9 10 my ($self, %args) = @_;
10 10 ▶ $args{cc} //= ['cc'];
Condition50%1/2
$args{"cc"} //= ["cc"]
l!l
100
MC/DC0%0/1
$args{"cc"} //= ["cc"]
$args{"cc"}
Truth table50%1/2
A
A= $args{"cc"}
Aresult
11
00
11 10 $self->SUPER::_init(%args);
12 10 $self->{cccdlflags} = $args{cccdlflags};
13 10 ▶ $self->{pic} = $args{pic} // ($self->type eq 'shared-library' || $self->type eq 'loadable-object') && @{ $self->{cccdlflags} };
Condition66%6/9
$args{"pic"} // ($self->type eq "shared-library" || $self->type eq "loadable-object") && @{$self->{"cccdlflags"};}
l!l&&r!l&&!r
0100
$self->type eq "shared-library" || $self->type eq "loadable-object" and @{$self->{"cccdlflags"};}
!ll&&!rl&&r
532
$self->type eq "shared-library" or $self->type eq "loadable-object"
l!l&&r!l&&!r
055
MC/DC50%2/4
$args{"pic"} // ($self->type eq "shared-library" || $self->type eq "loadable-object") && @{$self->{"cccdlflags"};}
$args{"pic"} $self->type eq "shared-library" $self->type eq "loadable-object" @{$self->{"cccdlflags"};}
Truth table50%3/6
A // B or C and D
A= $args{"pic"}B= $self->type eq "shared-library"C= $self->type eq "loadable-object"D= @{$self->{"cccdlflags"};}
ABCDresult
1XXX1
01X11
00111
000X0
01X00
00100
14 10 return;
15 }
16  
17 10 ▶sub compile_flags {
Subroutine compile_flags: called CC=6 SCAR=17.9
Pod undocumented
18 10 my ($self, $from, $to) = @_;
19 10 my @ret;
20 10 push @ret, $self->new_argument(ranking => 75, value => [ '-o' => $to, '-c', $from ]);
21 10 ▶ push @ret, $self->new_argument(ranking => 45, value => $self->{cccdlflags}) if $self->{pic};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"pic"} 2 8 10
22 10 ▶ push @ret, $self->new_argument(ranking => 15, value => [ "-std=$self->{standard}"]) if $self->{standard};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"standard"} 1 9 10
23 10 push @ret, map { $self->new_argument(ranking => $_->{ranking}, value => [ "-I$_->{value}" ]) } @{ $self->{include_dirs} };
24 10 for my $entry (@{ $self->{defines} }) {
25 4 my $key = $entry->{key};
26 4 ▶ my $value = defined $entry->{value} ? $entry->{value} ne '' ? "-D$key=$entry->{value}" : "-D$key" : "-U$key";
Branch: 2 branches
BranchTrueFalseTotal
defined $entry->{'value'} ? : 2 2 4
$entry->{'value'} ne '' ? : 1 1 2
27 4 push @ret, $self->new_argument(ranking => $entry->{ranking}, value => [$value]);
28 }
29 10 return @ret;
30 }
31  
32 3 1;
33  
34 #ABSTRACT: Class for compiling with a unix compiler
35  
36 __END__
« Linker/ELF/Any.pm ↑ Summary Linker/COFF.pm »