}
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/
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;
}
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);
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) {
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'",
### 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'),
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) ) {
'[' . $_->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);