t/00-compile.t

filter: Statementstmt 90.4% 38 / 42 Branchbran 43.7% 7 / 16 Conditioncond 27.2% 3 / 11 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 67.4% 56 / 83 SCAR 0.3
CC
1
Cov
70%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Task/Bootstrap/Perl/CPAN.pm ↑ Summary lib/Task/Bootstrap/Perl/CPAN.pm »
1 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054
6  
7 1 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
Branch: 1 branch
BranchTrueFalseTotal
$ENV{'AUTHOR_TESTING'} ? : 0 1 1
10  
11 1 my @module_files = (
12 'Task/Bootstrap/Perl/CPAN.pm'
13 );
14  
15  
16  
17 # no fake home requested
18  
19 1 ▶my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
Branch: 1 branch
BranchTrueFalseTotal
-d 'blib' ? : 0 1 1
20  
21 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use IPC::Open3;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use IO::Handle;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 1 ▶open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
Branch: 1 branch
BranchTrueFalseTotal
open my $stdin, "<", "File::Spec"->devnull or die "can't open devnull: $!" 0 1 1
26  
27 1 my @warnings;
28 1 for my $lib (@module_files)
29 {
30 # see L<perlfaq8/How can I capture STDERR from an external command?>
31 1 my $stderr = IO::Handle->new;
32  
33 1 my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
34 1 ▶ binmode $stderr, ':crlf' if $^O eq 'MSWin32';
Branch: 1 branch
BranchTrueFalseTotal
if $^O eq "MSWin32" 0 1 1
35 1 my @_warnings = <$stderr>;
36 1 waitpid($pid, 0);
37 1 is($?, 0, "$lib loaded ok");
38  
39 shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
40 1 ▶ and not eval { require blib; blib->VERSION('1.01') };
Branch: 1 branch
BranchTrueFalseTotal
if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { do { require blib; "blib"->VERSION("1.01") } } 0 1 1
Condition33%2/6
@_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { do { require blib; "blib"->VERSION("1.01") } }
!ll&&!rl&&r
100
@_warnings and $_warnings[0] =~ /^Using .*\bblib/
!ll&&!rl&&r
100
MC/DC0%0/3
@_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { do { require blib; "blib"->VERSION("1.01") } }
@_warnings $_warnings[0] =~ /^Using .*\bblib/ not eval { do { require blib; "blib"->VERSION("1.01") } }
Truth table0%0/4
A and B and not(C)
A= @_warningsB= $_warnings[0] =~ /^Using .*\bblib/C= not eval { do { require blib; "blib"->VERSION("1.01") } }
ABCresult
0XX0
10X0
1100
1111
41  
42 1 ▶ if (@_warnings)
Branch: 1 branch
BranchTrueFalseTotal
if (@_warnings) 0 1 1
43 {
44 0 warn @_warnings;
45 0 push @warnings, @_warnings;
46 }
47 }
48  
49  
50  
51 is(scalar(@warnings), 0, 'no warnings found')
52 1 ▶ or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING};
Branch: 2 branches
BranchTrueFalseTotal
if $ENV{"AUTHOR_TESTING"} 0 1 1
'Test::More'->can('explain') ? : 0 0 0
Condition20%1/5
$ENV{'AUTHOR_TESTING'} && (&is(scalar @warnings, 0, 'no warnings found') || diag('got warnings: ', 'Test::More'->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings)))
!ll
10
&is(scalar @warnings, 0, "no warnings found") or diag("got warnings: ", "Test::More"->can("explain") ? Test::More::explain(\@warnings) : join("\n", "", @warnings))
l!l&&r!l&&!r
000
MC/DC0%0/3
$ENV{'AUTHOR_TESTING'} && (&is(scalar @warnings, 0, 'no warnings found') || diag('got warnings: ', 'Test::More'->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings)))
$ENV{'AUTHOR_TESTING'} &is(scalar @warnings, 0, "no warnings found") diag("got warnings: ", "Test::More"->can("explain") ? Test::More::explain(\@warnings) : join("\n", "", @warnings))
Truth table0%0/4
A && B or C
A= $ENV{'AUTHOR_TESTING'}B= &is(scalar @warnings, 0, "no warnings found")C= diag("got warnings: ", "Test::More"->can("explain") ? Test::More::explain(\@warnings) : join("\n", "", @warnings))
ABCresult
0XX0
1000
11X1
1011
53  
54  
« blib/lib/Task/Bootstrap/Perl/CPAN.pm ↑ Summary lib/Task/Bootstrap/Perl/CPAN.pm »