| 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
| |||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||
| 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
Condition33%2/6
@_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval {
do {
require blib;
"blib"->VERSION("1.01")
}
}
@_warnings and $_warnings[0] =~ /^Using .*\bblib/
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")
}
}
| |||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | ▶ | if (@_warnings) | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 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
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)))
&is(scalar @warnings, 0, "no warnings found") or diag("got warnings: ", "Test::More"->can("explain") ? Test::More::explain(\@warnings) : join("\n", "", @warnings))
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))
| |||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||