summaryrefslogtreecommitdiff
path: root/cpan
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2012-02-14 09:47:13 +0000
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2012-02-14 09:47:13 +0000
commit2364a08e47a3014763c7abe2471e9378c7737f0c (patch)
tree0aa565f748466bf6e88a75f7931e08543d136fda /cpan
parent89ddfa67a6a250f3a10f2b56016a72efe32a5c56 (diff)
downloadperl-2364a08e47a3014763c7abe2471e9378c7737f0c.tar.gz
Update CPANPLUS to CPAN version 0.9118
[DELTA] Changes for 0.9118 Mon Feb 13 22:29:33 2012 ================================================ * Test reporting enhancements
Diffstat (limited to 'cpan')
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS.pm2
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm17
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Internals.pm2
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm17
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm22
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm2
6 files changed, 56 insertions, 6 deletions
diff --git a/cpan/CPANPLUS/lib/CPANPLUS.pm b/cpan/CPANPLUS/lib/CPANPLUS.pm
index 995308c003..3367aed23c 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS.pm
@@ -13,7 +13,7 @@ BEGIN {
use vars qw( @EXPORT @ISA $VERSION );
@EXPORT = qw( shell fetch get install );
@ISA = qw( Exporter );
- $VERSION = "0.9116"; #have to hardcode or cpan.org gets unhappy
+ $VERSION = "0.9118"; #have to hardcode or cpan.org gets unhappy
}
### purely for backward compatibility, so we can call it from the commandline:
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm b/cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm
index 9121a9502f..cd428691bc 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm
@@ -604,6 +604,7 @@ sub create {
}
my $fail; my $prereq_fail; my $test_fail;
+ my $status = { };
RUN: {
### this will set the directory back to the start
### dir, so we must chdir /again/
@@ -645,6 +646,10 @@ sub create {
verbose => $verbose )
) {
error( loc( "MAKE failed: %1 %2", $!, $captured ) );
+ if ( $conf->get_conf('cpantest') ) {
+ $status->{stage} = 'build';
+ $status->{capture} = $captured;
+ }
$dist->status->make(0);
$fail++; last RUN;
}
@@ -695,10 +700,20 @@ sub create {
msg( loc( "MAKE TEST passed: %1", $captured ), 0 );
}
+ if ( $conf->get_conf('cpantest') ) {
+ $status->{stage} = 'test';
+ $status->{capture} = $captured;
+ }
+
$dist->status->test(1);
} else {
error( loc( "MAKE TEST failed: %1", $captured ), ( $run_verbose ? 0 : 1 ) );
+ if ( $conf->get_conf('cpantest') ) {
+ $status->{stage} = 'test';
+ $status->{capture} = $captured;
+ }
+
### send out error report here? or do so at a higher level?
### --higher level --kane.
$dist->status->test(0);
@@ -720,6 +735,7 @@ sub create {
error( loc( "Could not chdir back to start dir '%1'", $orig ) );
}
+ ### TODO: Add $stage to _send_report()
### send out test report?
### only do so if the failure is this module, not its prereq
if( $conf->get_conf('cpantest') and not $prereq_fail) {
@@ -727,6 +743,7 @@ sub create {
module => $self,
failed => $test_fail || $fail,
buffer => CPANPLUS::Error->stack_as_string,
+ status => $status,
verbose => $verbose,
force => $force,
) or error(loc("Failed to send test report for '%1'",
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm
index 9295e1be12..a0fa443a7b 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm
@@ -42,7 +42,7 @@ use vars qw[@ISA $VERSION];
CPANPLUS::Internals::Report
];
-$VERSION = "0.9116";
+$VERSION = "0.9118";
=pod
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm
index 562a5edb6b..294de69236 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm
@@ -200,6 +200,23 @@ $buffer
.
};
+use constant REPORT_MESSAGE_PASS_HEADER
+ => sub {
+ my($stage, $buffer) = @_;
+ return << ".";
+
+Thank you for uploading your work to CPAN. Congratulations!
+All tests were successful.
+
+TEST RESULTS:
+
+Below is the error stack from stage '$stage':
+
+$buffer
+
+.
+ };
+
use constant REPORT_MISSING_PREREQS
=> sub {
my ($author,$email,@missing) = @_;
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm
index f704bf0091..24d4c62b59 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm
@@ -297,11 +297,12 @@ sub _send_report {
### check arguments ###
my ($buffer, $failed, $mod, $verbose, $force, $address, $save,
- $tests_skipped );
+ $tests_skipped, $status );
my $tmpl = {
module => { required => 1, store => \$mod, allow => IS_MODOBJ },
buffer => { required => 1, store => \$buffer },
failed => { required => 1, store => \$failed },
+ status => { default => {}, store => \$status, strict_type => 1 },
address => { default => CPAN_TESTERS_EMAIL, store => \$address },
save => { default => 0, store => \$save },
verbose => { default => $conf->get_conf('verbose'),
@@ -471,8 +472,9 @@ sub _send_report {
return 1 if $cp_conf =~ /\bmaketest_only\b/i
and ($stage !~ /\btest\b/);
+ my $capture = ( $status && defined $status->{capture} ? $status->{capture} : $buffer );
### the bit where we inform what went wrong
- $message .= REPORT_MESSAGE_FAIL_HEADER->( $stage, $buffer );
+ $message .= REPORT_MESSAGE_FAIL_HEADER->( $stage, $capture );
### was it missing prereqs? ###
if( my @missing = MISSING_PREREQS_LIST->($buffer) ) {
@@ -512,8 +514,22 @@ sub _send_report {
'[' . $_->tag . '] [' . $_->when . '] ' .
$_->message } ( CPANPLUS::Error->stack )[-1];
+ my $capture = ( $status && defined $status->{capture} ? $status->{capture} : $buffer );
### the bit where we inform what went wrong
- $message .= REPORT_MESSAGE_FAIL_HEADER->( $stage, $buffer );
+ $message .= REPORT_MESSAGE_FAIL_HEADER->( $stage, $capture );
+
+ ### add a list of what modules have been loaded of your prereqs list
+ $message .= REPORT_LOADED_PREREQS->($mod);
+
+ ### add a list of versions of toolchain modules
+ $message .= REPORT_TOOLCHAIN_VERSIONS->($mod);
+
+ ### the footer
+ $message .= REPORT_MESSAGE_FOOTER->();
+
+ } elsif ( $grade eq GRADE_PASS and ( $status and defined $status->{capture} ) ) {
+ ### the bit where we inform what went right
+ $message .= REPORT_MESSAGE_PASS_HEADER->( $stage, $status->{capture} );
### add a list of what modules have been loaded of your prereqs list
$message .= REPORT_LOADED_PREREQS->($mod);
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm b/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm
index c06c1a66c0..6a53391a04 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm
@@ -26,7 +26,7 @@ local $Data::Dumper::Indent = 1; # for dumpering from !
BEGIN {
use vars qw[ $VERSION @ISA ];
@ISA = qw[ CPANPLUS::Shell::_Base::ReadLine ];
- $VERSION = "0.9116";
+ $VERSION = "0.9118";
}
load CPANPLUS::Shell;