5 # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058
9 plan tests => 2 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
12 'Dist/Zilla/PluginBundle/Author/CCM.pm',
13 'Pod/Weaver/PluginBundle/Author/CCM.pm'
18 # no fake home requested
21 -d 'blib' ? '-Mblib' : '-Ilib',
28 open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
31 for my $lib (@module_files)
33 # see L<perlfaq8/How can I capture STDERR from an external command?>
34 my $stderr = IO::Handle->new;
36 diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
37 $^X, @switches, '-e', "require q[$lib]"))
38 if $ENV{PERL_COMPILE_TEST_DEBUG};
40 my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
41 binmode $stderr, ':crlf' if $^O eq 'MSWin32';
42 my @_warnings = <$stderr>;
44 is($?, 0, "$lib loaded ok");
46 shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
47 and not eval { +require blib; blib->VERSION('1.01') };
52 push @warnings, @_warnings;
58 is(scalar(@warnings), 0, 'no warnings found')
59 or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING};