diff --git a/lib/App/cpanminus/script.pm b/lib/App/cpanminus/script.pm index eeb73128b..dbc3c06f3 100644 --- a/lib/App/cpanminus/script.pm +++ b/lib/App/cpanminus/script.pm @@ -89,6 +89,7 @@ sub new { uninstall_shadows => ($] < 5.012), skip_installed => 1, skip_satisfied => 0, + skip_report => 0, auto_cleanup => 7, # days pod2man => 1, installed_dists => 0, @@ -176,6 +177,7 @@ sub parse_options { 'installdeps' => \$self->{installdeps}, 'skip-installed!' => \$self->{skip_installed}, 'skip-satisfied!' => \$self->{skip_satisfied}, + 'skip-report!' => \$self->{skip_report}, 'reinstall' => sub { $self->{skip_installed} = 0 }, 'interactive!' => \$self->{interactive}, 'i|install' => sub { $self->{cmd} = 'install' }, @@ -378,7 +380,16 @@ sub setup_home { { open my $out, ">$self->{log}" or die "$self->{log}: $!" } $self->chat("cpanm (App::cpanminus) $VERSION on perl $] built for $Config{archname}\n" . - "Work directory is $self->{base}\n"); + "Work directory is $self->{base}\n" . + "Running with: " . join(' ', + grep { exists $self->{$_} && $self->{$_} } + qw(force notest test_only sudo verbose quiet self_contained + exclude_vendor prompt dev reinstall pure_perl + with_develop skip_installed skip_satisfied verify + interactive installdeps + ) + ) . "\n" + ); } sub fetch_meta_sco { @@ -1152,7 +1163,20 @@ sub test { $cmd = $self->append_args($cmd, 'test') if $depth == 0; - return 1 if $self->run_timeout($cmd, $self->{test_timeout}); + my $r = $self->run_timeout($cmd, $self->{test_timeout}); + + if ( !$self->{skip_report} + and !$self->{verbose} # verbose logging is not supported yet on cpanm + and eval 'use App::cpanminus::reporter 0.10; 1' + ) { + # we don't want cpanm to die if reporting fails + eval { + my $reporter = App::cpanminus::reporter->new( cpanm => $self, only => $distname ); + $reporter->run(); + }; + } + return 1 if $r; + if ($self->{force}) { $self->diag_fail("Testing $distname failed but installing it anyway."); return 1; diff --git a/script/cpanm.PL b/script/cpanm.PL index d4ab8442a..98d3bd3e2 100755 --- a/script/cpanm.PL +++ b/script/cpanm.PL @@ -164,6 +164,12 @@ Note that if you specify this option with a module or distribution that has dependencies, these dependencies will be installed if you don't currently have them. +=item --skip-report + +If L is found in the system, cpanm will +automatically send test reports to CPAN Testers unless you set this +option. + =item -S, --sudo Switch to the root user with C when installing modules. Use this