blib/lib/Devel/XSCover/Build.pm

filter: Statementstmt 100% 179 / 179 Branchbran 100% 92 / 92 Conditioncond 100% 45 / 45 MC/DCmcdc 100% 27 / 27 Subroutinesub 100% 30 / 30 Podpod 100% 14 / 14 totaltotal 100% 387 / 387 CC 71 SCAR 18.9
CC
71
Cov
100%
gcov_command
16.0
compiler
9.0
__ANON__
9.0
CRAP 6.6
« blib/lib/Devel/XSCover/XS.pm ↑ Summary blib/lib/Devel/XSCover/Deparse.pm »
1 package Devel::XSCover::Build;
2  
3 31 ▶use 5.020;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 31 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 31 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 31 ▶use Config ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 31 ▶use File::Find ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 31 ▶use File::Spec ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 31 ▶use IPC::Open3 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11 31 ▶use Symbol ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 31 our $VERSION = '0.09';
14  
15 31 our (%SOURCE_EXT, $COVERAGE);
16  
17 31 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
18 31 %SOURCE_EXT = map { $_ => 1 } qw(xs c cc cpp cxx h hh hpp);
19 31 $COVERAGE = '-fprofile-arcs -ftest-coverage';
20 }
21  
22 86 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
23 86 my ($class, %args) = @_;
24 my $self = bless {
25 dir => '.',
26 make => 'make',
27 perl => $^X,
28 cc => $Config::Config{cc},
29 86 gcov => undef,
30 conditions => undef,
31 flow => undef,
32 dry => 0,
33 silent => 0,
34 skip => [qw(blib cover_db .git)],
35 }, $class;
36 86 $self->{$_} = $args{$_} for keys %args;
37 86 return $self;
38 }
39  
40 1 ▶sub dir { $_[0]{dir} }
Subroutine dir: called CC=1 SCAR=0.0
Pod documented
41  
42 69 ▶sub compiler {
Subroutine compiler: called CC=9 SCAR=22.0
Pod documented
43 69 my ($self) = @_;
44 69 ▶ return $self->{compiler} if $self->{compiler};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"compiler"} 17 52 69
45 52 ▶ my $banner = $self->_capture($self->{cc}, '--version') // '';
Condition100%2/2
$self->_capture($self->{"cc"}, "--version") // ""
l!l
502
MC/DC100%1/1
$self->_capture($self->{"cc"}, "--version") // ""
$self->_capture($self->{"cc"}, "--version")
Truth table100%2/2
A
A= $self->_capture($self->{"cc"}, "--version")
Aresult
11
00
46 52 my ($first) = split /\n/, $banner;
47 52 ▶ $first //= '';
Condition100%2/2
$first //= ""
l!l
502
MC/DC100%1/1
$first //= ""
$first
Truth table100%2/2
A
A= $first
Aresult
11
00
48 52 my %c = (cc => $self->{cc}, name => 'unknown', major => 0, banner => $first);
49 52 ▶ if ($first =~ /clang version (\d+)/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($first =~ /clang version (\d+)/u) { } 12 40 52
elsif ($first =~ /\b(?:gcc|g\+\+|GCC)\b/u or $banner =~ /Free Software Foundation/u or $first =~ /^\S+ \([^)]*\) \d+\.\d+(?:\.\d+)?\b/u) { } 37 3 40
50 12 @c{qw(name major)} = ('clang', $1);
51 }
52 ▶ elsif ($first =~ /\b(?:gcc|g\+\+|GCC)\b/ || $banner =~ /Free Software Foundation/
Condition100%6/6
$first =~ /\b(?:gcc|g\+\+|GCC)\b/u or $banner =~ /Free Software Foundation/u or $first =~ /^\S+ \([^)]*\) \d+\.\d+(?:\.\d+)?\b/u
l!l&&r!l&&!r
3613
$first =~ /\b(?:gcc|g\+\+|GCC)\b/u or $banner =~ /Free Software Foundation/u
l!l&&r!l&&!r
8284
MC/DC100%3/3
$first =~ /\b(?:gcc|g\+\+|GCC)\b/u or $banner =~ /Free Software Foundation/u or $first =~ /^\S+ \([^)]*\) \d+\.\d+(?:\.\d+)?\b/u
$first =~ /\b(?:gcc|g\+\+|GCC)\b/u $banner =~ /Free Software Foundation/u $first =~ /^\S+ \([^)]*\) \d+\.\d+(?:\.\d+)?\b/u
Truth table100%4/4
A or B or C
A= $first =~ /\b(?:gcc|g\+\+|GCC)\b/uB= $banner =~ /Free Software Foundation/uC= $first =~ /^\S+ \([^)]*\) \d+\.\d+(?:\.\d+)?\b/u
ABCresult
1XX1
01X1
0011
0000
53 || $first =~ /^\S+ \([^)]*\) \d+\.\d+(?:\.\d+)?\b/) {
54 37 ▶ @c{qw(name major)} = ('gcc', $first =~ /(\d+)\.\d+(?:\.\d+)?/ ? $1 : 0);
Branch: 1 branch
BranchTrueFalseTotal
$first =~ /(\d+)\.\d+(?:\.\d+)?/u ? : 36 1 37
55 }
56 52 return $self->{compiler} = \%c;
57 }
58  
59 48 ▶sub gcov_command {
Subroutine gcov_command: called CC=16 SCAR=27.7
Pod documented
60 48 my ($self) = @_;
61 48 ▶ return [ split ' ', $self->{gcov} ] if defined $self->{gcov} && length $self->{gcov};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"gcov"} and length $self->{"gcov"} 29 19 48
Condition100%3/3
defined $self->{"gcov"} and length $self->{"gcov"}
!ll&&!rl&&r
18129
MC/DC100%2/2
defined $self->{"gcov"} and length $self->{"gcov"}
defined $self->{"gcov"} length $self->{"gcov"}
Truth table100%3/3
A and B
A= defined $self->{"gcov"}B= length $self->{"gcov"}
ABresult
0X0
100
111
62 19 my $c = $self->compiler;
63 19 ▶ if ($c->{name} eq 'clang') {
Branch: 1 branch
BranchTrueFalseTotal
if ($c->{"name"} eq "clang") 12 7 19
64 12 my $gcov = $self->_which('gcov');
65 12 ▶ if ($gcov) {
Branch: 1 branch
BranchTrueFalseTotal
if ($gcov) 5 7 12
66 5 ▶ my $banner = $self->_capture($gcov, '--version') // '';
Condition100%2/2
$self->_capture($gcov, "--version") // ""
l!l
41
MC/DC100%1/1
$self->_capture($gcov, "--version") // ""
$self->_capture($gcov, "--version")
Truth table100%2/2
A
A= $self->_capture($gcov, "--version")
Aresult
11
00
67 5 ▶ return [$gcov] if $banner =~ /LLVM/;
Branch: 1 branch
BranchTrueFalseTotal
if $banner =~ /LLVM/u 1 4 5
68 }
69 11 for my $name ("llvm-cov-$c->{major}", 'llvm-cov') {
70 21 my $path = $self->_which($name);
71 21 ▶ return [$path, 'gcov'] if $path;
Branch: 1 branch
BranchTrueFalseTotal
if $path 3 18 21
72 }
73 8 ▶ if ($^O eq 'darwin') {
Branch: 1 branch
BranchTrueFalseTotal
if ($^O eq "darwin") 4 4 8
74 4 ▶ my $found = $self->_capture('xcrun', '--find', 'llvm-cov') // '';
Condition100%2/2
$self->_capture("xcrun", "--find", "llvm-cov") // ""
l!l
31
MC/DC100%1/1
$self->_capture("xcrun", "--find", "llvm-cov") // ""
$self->_capture("xcrun", "--find", "llvm-cov")
Truth table100%2/2
A
A= $self->_capture("xcrun", "--find", "llvm-cov")
Aresult
11
00
75 4 chomp $found;
76 4 ▶ return [$found, 'gcov'] if length $found && -x $found;
Branch: 1 branch
BranchTrueFalseTotal
if length $found and -x $found 1 3 4
Condition100%3/3
length $found and -x $found
!ll&&!rl&&r
211
MC/DC100%2/2
length $found and -x $found
length $found -x $found
Truth table100%3/3
A and B
A= length $foundB= -x $found
ABresult
0X0
100
111
77 }
78 7 ▶ return [ $gcov || 'gcov' ];
Condition100%2/2
$gcov || 'gcov'
l!l
25
MC/DC100%1/1
$gcov || 'gcov'
$gcov
Truth table100%2/2
A
A= $gcov
Aresult
11
00
79 }
80 7 for my $name ("gcov-$c->{major}", 'gcov') {
81 11 my $path = $self->_which($name);
82 11 ▶ return [$path] if $path;
Branch: 1 branch
BranchTrueFalseTotal
if $path 6 5 11
83 }
84 1 return ['gcov'];
85 }
86  
87 43 ▶sub conditions {
Subroutine conditions: called CC=5 SCAR=16.1
Pod documented
88 43 my ($self) = @_;
89 43 ▶ return $self->{conditions} ? 1 : 0 if defined $self->{conditions};
Branch: 2 branches
BranchTrueFalseTotal
if defined $self->{"conditions"} 6 37 43
$self->{'conditions'} ? : 1 5 6
90 37 my $c = $self->compiler;
91 37 ▶ return $c->{name} eq 'gcc' && $c->{major} >= 14 ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$c->{'name'} eq 'gcc' && $c->{'major'} >= 14 ? : 2 35 37
Condition100%3/3
$c->{"name"} eq "gcc" and $c->{"major"} >= 14
!ll&&!rl&&r
1342
MC/DC100%2/2
$c->{"name"} eq "gcc" and $c->{"major"} >= 14
$c->{"name"} eq "gcc" $c->{"major"} >= 14
Truth table100%3/3
A and B
A= $c->{"name"} eq "gcc"B= $c->{"major"} >= 14
ABresult
0X0
100
111
92 }
93  
94 20 ▶sub flow_kind {
Subroutine flow_kind: called CC=6 SCAR=17.9
Pod documented
95 20 my ($self) = @_;
96 20 ▶ return $self->{flow} if defined $self->{flow};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"flow"} 2 18 20
97 18 ▶ my $banner = $self->_capture(@{ $self->gcov_command }, '--version') // '';
Condition100%2/2
$self->_capture(@{$self->gcov_command;}, "--version") // ""
l!l
162
MC/DC100%1/1
$self->_capture(@{$self->gcov_command;}, "--version") // ""
$self->_capture(@{$self->gcov_command;}, "--version")
Truth table100%2/2
A
A= $self->_capture(@{$self->gcov_command;}, "--version")
Aresult
11
00
98 18 ▶ return $self->{flow} = 'llvm' if $banner =~ /LLVM/;
Branch: 1 branch
BranchTrueFalseTotal
if $banner =~ /LLVM/u 2 16 18
99 16 ▶ return $self->{flow} = 'gcc' if $banner =~ /\b(\d+)\.\d+(?:\.\d+)?\b/ && $1 >= 9;
Branch: 1 branch
BranchTrueFalseTotal
if $banner =~ /\b(\d+)\.\d+(?:\.\d+)?\b/u and $1 >= 9 3 13 16
Condition100%3/3
$banner =~ /\b(\d+)\.\d+(?:\.\d+)?\b/u and $1 >= 9
!ll&&!rl&&r
1213
MC/DC100%2/2
$banner =~ /\b(\d+)\.\d+(?:\.\d+)?\b/u and $1 >= 9
$banner =~ /\b(\d+)\.\d+(?:\.\d+)?\b/u $1 >= 9
Truth table100%3/3
A and B
A= $banner =~ /\b(\d+)\.\d+(?:\.\d+)?\b/uB= $1 >= 9
ABresult
0X0
100
111
100 13 return $self->{flow} = '';
101 }
102  
103 27 ▶sub flags {
Subroutine flags: called CC=2 SCAR=6.9
Pod documented
104 27 my ($self) = @_;
105 27 ▶ my $condition = $self->conditions ? ' -fcondition-coverage' : '';
Branch: 1 branch
BranchTrueFalseTotal
$self->conditions ? : 1 26 27
106 return (
107 27 "OPTIMIZE=-O0 -g $COVERAGE -fprofile-update=atomic$condition",
108 "OTHERLDFLAGS=$COVERAGE",
109 );
110 }
111  
112 30 ▶sub needs_configure {
Subroutine needs_configure: called CC=4 SCAR=13.9
Pod documented
113 30 my ($self) = @_;
114 30 my $makefile = File::Spec->catfile($self->{dir}, 'Makefile');
115 30 my $pl = File::Spec->catfile($self->{dir}, 'Makefile.PL');
116 30 ▶ return 1 unless -f $makefile;
Branch: 1 branch
BranchTrueFalseTotal
unless -f $makefile 6 24 30
117 24 ▶ return 1 unless -f $pl;
Branch: 1 branch
BranchTrueFalseTotal
unless -f $pl 1 23 24
118 23 ▶ return (stat $makefile)[9] < (stat $pl)[9] ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
(stat $makefile)[9] < (stat $pl)[9] ? : 3 20 23
119 }
120  
121 15 ▶sub clean_globs {
Subroutine clean_globs: called CC=6 SCAR=17.9
Pod documented
122 15 my ($self) = @_;
123 15 my $pl = File::Spec->catfile($self->{dir}, 'Makefile.PL');
124 15 ▶ open my $fh, '<', $pl or return;
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<", $pl or return 13 2 15
125 13 my $text = do { local $/; <$fh> };
126 13 close $fh;
127 13 my @globs;
128 13 ▶ while ($text =~ /clean\s*=>\s*\{[^}]*?FILES\s*=>\s*(['"])(.*?)\1/sg) {
Branch: 1 branch
BranchTrueFalseTotal
if ($text =~ /clean\s*=>\s*\{[^}]*?FILES\s*=>\s*(['"])(.*?)\1/gsu) 13 13 26
129 13 push @globs, split ' ', $2;
130 }
131 13 ▶ my ($name) = $text =~ /\bNAME\s*=>\s*(['"])(.*?)\1/ ? $2 : '';
Branch: 1 branch
BranchTrueFalseTotal
$text =~ /\bNAME\s*=>\s*(['"])(.*?)\1/u ? : 11 2 13
132 13 (my $dist = $name) =~ s/::/-/g;
133 13 my @out;
134 13 for my $glob (@globs) {
135 23 $glob =~ s/\$\(DISTNAME\)/$dist/g;
136 23 ▶ next if $glob =~ /\$\(/;
Branch: 1 branch
BranchTrueFalseTotal
if $glob =~ /\$\(/u 2 21 23
137 21 push @out, $glob;
138 }
139 13 return @out;
140 }
141  
142 10 ▶sub tarballs_at_risk {
Subroutine tarballs_at_risk: called CC=6 SCAR=17.9
Pod documented
143 10 my ($self) = @_;
144 10 my %seen;
145 my @hit;
146 10 for my $glob ($self->clean_globs) {
147 31 ▶ for my $file (glob File::Spec->catfile($self->{dir}, $glob)) {
Subroutine BEGIN: called CC=1 SCAR=0.0
148 12 ▶ next unless $file =~ /\.(?:tar\.gz|tgz|zip)\z/ && -f $file;
Branch: 1 branch
BranchTrueFalseTotal
unless $file =~ /\.(?:tar\.gz|tgz|zip)\z/u and -f $file 5 7 12
Condition100%3/3
$file =~ /\.(?:tar\.gz|tgz|zip)\z/u and -f $file
!ll&&!rl&&r
417
MC/DC100%2/2
$file =~ /\.(?:tar\.gz|tgz|zip)\z/u and -f $file
$file =~ /\.(?:tar\.gz|tgz|zip)\z/u -f $file
Truth table100%3/3
A and B
A= $file =~ /\.(?:tar\.gz|tgz|zip)\z/uB= -f $file
ABresult
0X0
100
111
149 7 ▶ push @hit, $file unless $seen{$file}++;
Branch: 1 branch
BranchTrueFalseTotal
unless $seen{$file}++ 6 1 7
150 }
151 }
152 10 return @hit;
153 }
154  
155 25 ▶sub configure {
Subroutine configure: called CC=4 SCAR=13.9
Pod documented
156 25 my ($self) = @_;
157 25 ▶ return 0 unless $self->needs_configure;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->needs_configure 18 7 25
158 7 ▶ if (-f File::Spec->catfile($self->{dir}, 'Makefile')) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f "File::Spec"->catfile($self->{"dir"}, "Makefile")) 2 5 7
159 2 my @risk = $self->tarballs_at_risk;
160 2 ▶ warn "xs_cover: a stale Makefile reruns clean by itself, and the clean glob in "
Branch: 1 branch
BranchTrueFalseTotal
if @risk 1 1 2
161 . "Makefile.PL matches @risk\n" if @risk;
162 }
163 7 return $self->_run($self->{perl}, 'Makefile.PL');
164 }
165  
166 33 ▶sub touch {
Subroutine touch: called CC=2 SCAR=6.9
Pod documented
167 33 my ($self) = @_;
168 33 my %skip = map { $_ => 1 } @{ $self->{skip} };
169 33 my $top = _slashes($self->{dir});
170 33 my $now = time;
171 33 my @touched;
172 File::Find::find({
173 no_chdir => 1,
174 407 ▶ wanted => sub {
Subroutine __ANON__: called CC=9 SCAR=22.0
175 407 ▶ if (-d $_) {
Branch: 1 branch
BranchTrueFalseTotal
if (-d $_) 111 296 407
176 111 my $base = (File::Spec->splitdir($_))[-1];
177 111 ▶ $File::Find::prune = 1 if $skip{$base} && _slashes($_) ne $top;
Branch: 1 branch
BranchTrueFalseTotal
if $skip{$base} and _slashes($_) ne $top 12 99 111
Condition100%3/3
$skip{$base} and _slashes($_) ne $top
!ll&&!rl&&r
97212
MC/DC100%2/2
$skip{$base} and _slashes($_) ne $top
$skip{$base} _slashes($_) ne $top
Truth table100%3/3
A and B
A= $skip{$base}B= _slashes($_) ne $top
ABresult
0X0
100
111
178 111 return;
179 }
180 296 ▶ return unless /\.([A-Za-z]+)\z/ && $SOURCE_EXT{ lc $1 };
Branch: 1 branch
BranchTrueFalseTotal
unless /\.([A-Za-z]+)\z/u and $Devel::XSCover::Build::SOURCE_EXT{lc $1} 207 89 296
Condition100%3/3
/\.([A-Za-z]+)\z/u and $Devel::XSCover::Build::SOURCE_EXT{lc $1}
!ll&&!rl&&r
1317689
MC/DC100%2/2
/\.([A-Za-z]+)\z/u and $Devel::XSCover::Build::SOURCE_EXT{lc $1}
/\.([A-Za-z]+)\z/u $Devel::XSCover::Build::SOURCE_EXT{lc $1}
Truth table100%3/3
A and B
A= /\.([A-Za-z]+)\z/uB= $Devel::XSCover::Build::SOURCE_EXT{lc $1}
ABresult
0X0
100
111
181 89 ▶ return if lc $1 eq 'c' && -f substr($_, 0, -1) . 'xs';
Branch: 1 branch
BranchTrueFalseTotal
if lc $1 eq "c" and -f substr($_, 0, -1) . 'xs' 11 78 89
Condition100%3/3
lc $1 eq "c" and -f substr($_, 0, -1) . 'xs'
!ll&&!rl&&r
631511
MC/DC100%2/2
lc $1 eq "c" and -f substr($_, 0, -1) . 'xs'
lc $1 eq "c" -f substr($_, 0, -1) . 'xs'
Truth table100%3/3
A and B
A= lc $1 eq "c"B= -f substr($_, 0, -1) . 'xs'
ABresult
0X0
100
111
182 78 push @touched, $_;
183 78 ▶ utime $now, $now, $_ unless $self->{dry};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"dry"} 61 17 78
184 },
185 33 }, $self->{dir});
186 33 ▶ $self->_say(sprintf 'xs_cover: touched %d source file%s', scalar @touched, @touched == 1 ? '' : 's');
Branch: 1 branch
BranchTrueFalseTotal
@touched == 1 ? : 18 15 33
187 33 return @touched;
188 }
189  
190 24 ▶sub build {
Subroutine build: called CC=1 SCAR=0.0
Pod documented
191 24 my ($self) = @_;
192 24 return $self->_run($self->{make}, $self->flags);
193 }
194  
195 20 ▶sub run {
Subroutine run: called CC=2 SCAR=6.9
Pod documented
196 20 my ($self) = @_;
197 20 my $status = $self->configure;
198 20 ▶ return $status if $status;
Branch: 1 branch
BranchTrueFalseTotal
if $status 1 19 20
199 19 $self->touch;
200 19 return $self->build;
201 }
202  
203 31 ▶sub _run {
Subroutine _run: called CC=5 SCAR=16.1
204 31 my ($self, @cmd) = @_;
205 31 $self->_say("xs_cover: running @cmd");
206 31 ▶ return 0 if $self->{dry};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"dry"} 7 24 31
207 24 my $status;
208 24 ▶ if ($self->{dir} eq '.') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'dir'} eq '.') { } 1 23 24
209 1 $status = system @cmd;
210 }
211 else {
212 23 require Cwd;
213 23 my $here = Cwd::getcwd();
214 23 ▶ chdir $self->{dir} or die "xs_cover: cannot chdir to $self->{dir}: $!\n";
Branch: 1 branch
BranchTrueFalseTotal
chdir $self->{"dir"} or die qq[xs_cover: cannot chdir to $self->{"dir"}: $!\n] 22 1 23
215 22 $status = system @cmd;
216 22 chdir $here;
217 }
218 23 ▶ return $status == -1 ? 127 : $status >> 8;
Branch: 1 branch
BranchTrueFalseTotal
$status == -1 ? : 1 22 23
219 }
220  
221 64 ▶sub _say {
Subroutine _say: called CC=2 SCAR=6.9
222 64 my ($self, $line) = @_;
223 64 ▶ print "$line\n" unless $self->{silent};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"silent"} 34 30 64
224 }
225  
226 75 ▶sub _capture {
Subroutine _capture: called CC=2 SCAR=6.9
227 75 my ($self, @cmd) = @_;
228 75 local *NULL;
229 75 open NULL, '>', File::Spec->devnull;
230 75 my ($in, $out) = (undef, Symbol::gensym());
231 75 my $pid = eval { IPC::Open3::open3($in, $out, '>&NULL', @cmd) };
232 75 ▶ return undef unless $pid;
Branch: 1 branch
BranchTrueFalseTotal
unless $pid 2 73 75
233 73 close $in;
234 73 my $text = do { local $/; <$out> };
235 73 close $out;
236 73 waitpid $pid, 0;
237 73 return $text;
238 }
239  
240 47 ▶sub _slashes {
Subroutine _slashes: called CC=2 SCAR=6.9
241 47 my ($path) = @_;
242 47 ▶ $path =~ s{\\}{/}g if $^O eq 'MSWin32';
Branch: 1 branch
BranchTrueFalseTotal
if $^O eq "MSWin32" 2 45 47
243 47 return $path;
244 }
245  
246 44 ▶sub _which {
Subroutine _which: called CC=4 SCAR=13.9
247 44 my ($self, $name) = @_;
248 44 for my $dir (File::Spec->path) {
249 58 my $path = File::Spec->catfile($dir, $name);
250 58 ▶ return $path if -f $path && -x $path;
Branch: 1 branch
BranchTrueFalseTotal
if -f $path and -x $path 14 44 58
Condition100%3/3
-f $path and -x $path
!ll&&!rl&&r
42214
MC/DC100%2/2
-f $path and -x $path
-f $path -x $path
Truth table100%3/3
A and B
A= -f $pathB= -x $path
ABresult
0X0
100
111
251 }
252 30 return undef;
253 }
254  
255 31 1;
256  
257 __END__
« blib/lib/Devel/XSCover/XS.pm ↑ Summary blib/lib/Devel/XSCover/Deparse.pm »