summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm36
1 files changed, 32 insertions, 4 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm
index 73a2d297e2d..6e3cd5641dc 100644
--- a/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm
+++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Internals/Report.pm
@@ -20,7 +20,7 @@ require CPANPLUS::Internals;
=head1 NAME
-CPANPLUS::Internals::Report
+CPANPLUS::Internals::Report - internals for sending test reports
=head1 SYNOPSIS
@@ -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) ) {
@@ -507,8 +509,34 @@ sub _send_report {
$message .= REPORT_TESTS_SKIPPED->();
} elsif( $grade eq GRADE_NA) {
+ my $capture = ( $status && defined $status->{capture} ? $status->{capture} : $buffer );
+
+ ### add the reason for the NA to the buffer
+ $capture = join $/, $capture, map {
+ '[' . $_->tag . '] [' . $_->when . '] ' .
+ $_->message } ( CPANPLUS::Error->stack )[-1];
+
### 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);
+
+ ### add a list of versions of toolchain modules
+ $message .= REPORT_TOOLCHAIN_VERSIONS->($mod);
### the footer
$message .= REPORT_MESSAGE_FOOTER->();