Author: BINGOS
Date: Sat Feb 11 13:53:03 2012
New Revision: 15140

Modified:
   CPANPLUS-Dist-Build/trunk/Changes
   CPANPLUS-Dist-Build/trunk/lib/CPANPLUS/Dist/Build.pm
   CPANPLUS-Dist-Build/trunk/lib/CPANPLUS/Dist/Build/Constants.pm

Log:
Test reporting enhancements

Modified: CPANPLUS-Dist-Build/trunk/Changes
==============================================================================
--- CPANPLUS-Dist-Build/trunk/Changes   (original)
+++ CPANPLUS-Dist-Build/trunk/Changes   Sat Feb 11 13:53:03 2012
@@ -1,5 +1,8 @@
 Revision history for Perl extension CPANPLUS::Dist::Build.
 
+0.61_01 Sat Feb 11 21:49:13 GMT 2012
+  - Test reporting enhancements
+
 0.60 Thu Oct 27 20:54:22 BST 2011
   - Eliminate the need to use 'perlwrapper' at all by using
     an equivalent one-liner.

Modified: CPANPLUS-Dist-Build/trunk/lib/CPANPLUS/Dist/Build.pm
==============================================================================
--- CPANPLUS-Dist-Build/trunk/lib/CPANPLUS/Dist/Build.pm        (original)
+++ CPANPLUS-Dist-Build/trunk/lib/CPANPLUS/Dist/Build.pm        Sat Feb 11 
13:53:03 2012
@@ -30,7 +30,7 @@
 
 local $Params::Check::VERBOSE = 1;
 
-$VERSION = '0.60';
+$VERSION = '0.61_01';
 
 =pod
 
@@ -269,7 +269,8 @@
     my @buildflags = $dist->_buildflags_as_list( $buildflags );
     $dist->status->_buildflags( $buildflags );
 
-    my $fail;
+    my $fail; my $prereq_fail;
+    my $status = { };
     RUN: {
         # 0.85_01
         ### we resolve 'configure requires' here, so we can run the 'perl
@@ -298,6 +299,7 @@
                             "-- aborting install",
                             'configure_requires', $self->module ) );
                 $dist->status->prepared(0);
+                $prereq_fail++;
                 $fail++;
                 last RUN;
             }
@@ -318,6 +320,10 @@
                                 verbose => $verbose )
         ) {
             error( loc( "Build.PL failed: %1", $prep_output ) );
+            if ( $conf->get_conf('cpantest') ) {
+               $status->{stage} = 'prepare';
+               $status->{capture} = $prep_output;
+            }
             $fail++; last RUN;
         }
 
@@ -333,11 +339,12 @@
     }
 
     ### send out test report? ###
-    if( $fail and $conf->get_conf('cpantest') ) {
+    if( $fail and $conf->get_conf('cpantest') and not $prereq_fail ) {
            $cb->_send_report(
             module  => $self,
             failed  => $fail,
             buffer  => CPANPLUS::Error->stack_as_string,
+            status  => $status,
             verbose => $verbose,
             force   => $force,
         ) or error(loc("Failed to send test report for '%1'",
@@ -567,6 +574,7 @@
     $dist->status->_buildflags( $buildflags );
 
     my $fail; my $prereq_fail; my $test_fail;
+    my $status = { };
     RUN: {
 
         my @run_perl    = ( '-e', CPDB_PERL_WRAPPER );
@@ -610,6 +618,10 @@
         ) {
             error( loc( "MAKE failed:\n%1", $captured ) );
             $dist->status->build(0);
+            if ( $conf->get_conf('cpantest') ) {
+               $status->{stage} = 'build';
+               $status->{capture} = $captured;
+            }
             $fail++; last RUN;
         }
 
@@ -645,6 +657,10 @@
                                       $self, $@ )
                 ) {
                     $dist->status->test(0);
+                    if ( $conf->get_conf('cpantest') ) {
+                      $status->{stage} = 'test';
+                      $status->{capture} = $test_output;
+                    }
                     $fail++; last RUN;
                 }
 
@@ -652,6 +668,10 @@
             else {
                 msg( loc( "MAKE TEST passed:\n%1", $test_output ), 0 );
                 $dist->status->test(1);
+                if ( $conf->get_conf('cpantest') ) {
+                   $status->{stage} = 'test';
+                   $status->{capture} = $test_output;
+                }
             }
         }
         else {
@@ -669,6 +689,7 @@
             module          => $self,
             failed          => $test_fail || $fail,
             buffer          => CPANPLUS::Error->stack_as_string,
+            status          => $status,
             verbose         => $verbose,
             force           => $force,
             tests_skipped   => $skiptest,

Modified: CPANPLUS-Dist-Build/trunk/lib/CPANPLUS/Dist/Build/Constants.pm
==============================================================================
--- CPANPLUS-Dist-Build/trunk/lib/CPANPLUS/Dist/Build/Constants.pm      
(original)
+++ CPANPLUS-Dist-Build/trunk/lib/CPANPLUS/Dist/Build/Constants.pm      Sat Feb 
11 13:53:03 2012
@@ -9,7 +9,7 @@
     require Exporter;
     use vars    qw[$VERSION @ISA @EXPORT];
 
-    $VERSION    = '0.60';
+    $VERSION    = '0.61_01';
     @ISA        = qw[Exporter];
     @EXPORT     = qw[ BUILD_DIR BUILD CPDB_PERL_WRAPPER];
 }

Reply via email to