Author: ericwilhelm
Date: Sun Feb 18 17:52:35 2007
New Revision: 9130

Modified:
   Module-Build/trunk/lib/Module/Build/Base.pm
   Module-Build/trunk/t/test_types.t

Log:
lib/Module/Build/Base.pm - testall needs to stick to file-based tests for now
                           (dispatching to the test<action> creates too many 
summaries)
t/test_types.t           - verify that we only have one summary


Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Sun Feb 18 17:52:35 2007
@@ -2014,9 +2014,17 @@
 sub ACTION_testall {
   my ($self) = @_;
 
-  for my $action ('', grep { $_ ne 'all' } $self->get_test_types) {
-    $self->_call_action( "test$action" );
+  my @types;
+  for my $action (grep { $_ ne 'all' } $self->get_test_types) {
+    # XXX We can't just dispatch because we get multiple summaries but
+    # we'll need to dispatch to support custom setup/teardown in the
+    # action.  To support that, we'll need to call something besides
+    # Harness::runtests() because we'll need to collect the results in
+    # parts, then run the summary.
+    push(@types, $action);
+    #$self->_call_action( "test$action" );
   }
+  $self->generic_test(types => ['default', @types]);
 }
 
 sub get_test_types {

Modified: Module-Build/trunk/t/test_types.t
==============================================================================
--- Module-Build/trunk/t/test_types.t   (original)
+++ Module-Build/trunk/t/test_types.t   Sun Feb 18 17:52:35 2007
@@ -2,7 +2,7 @@
 
 use strict;
 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
-use MBTest tests => 13 + 12;
+use MBTest tests => 14 + 12;
 
 use Cwd ();
 my $cwd = Cwd::cwd();
@@ -86,6 +86,8 @@
     sub {$mb->dispatch('testall', verbose => 1)}
 ));
 
+0 and warn "\ntestall said >>>\n$all_output\n<<<\n";
+
 like($all_output, qr/^OK 1 - FIRST TEST IN SPECIAL_EXT/m,
     'expected output from basic.t');
 like($all_output, qr/^OK 2 - SECOND TEST IN SPECIAL_EXT/m,
@@ -95,8 +97,9 @@
 like($all_output, qr/^OK 2 - SECOND TEST IN ANOTHER_EXT/m);
 
 # we get a third one from basic.t
-is(scalar(@{[$all_output =~ m/(OK 1)/mg]}), 3 );
-is(scalar(@{[$all_output =~ m/(OK)/mg]}),   8 );
+is(scalar(@{[$all_output =~ m/OK 1/mg]}), 3 );
+is(scalar(@{[$all_output =~ m/OK/mg]}),   8 );
+is(scalar(@{[$all_output =~ m/ALL TESTS SUCCESSFUL\./mg]}),   1);
 
 chdir($cwd) or die "Can't chdir to '$cwd': $!";
 $dist->remove;

Reply via email to