[Catalyst-commits] r13755 - in Catalyst-Runtime/5.80/trunk: . t t/author

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Sat Dec 4 21:19:37 GMT 2010


Author: rafl
Date: 2010-12-04 21:19:37 +0000 (Sat, 04 Dec 2010)
New Revision: 13755

Modified:
   Catalyst-Runtime/5.80/trunk/Makefile.PL
   Catalyst-Runtime/5.80/trunk/t/aggregate.t
   Catalyst-Runtime/5.80/trunk/t/author/http-server.t
Log:
Aggregate http-server.t tests

With this, I get to run the full suite in under 2 minutes again, as opposed to
the >3 minutes it took before.

Modified: Catalyst-Runtime/5.80/trunk/Makefile.PL
===================================================================
--- Catalyst-Runtime/5.80/trunk/Makefile.PL	2010-12-04 12:49:53 UTC (rev 13754)
+++ Catalyst-Runtime/5.80/trunk/Makefile.PL	2010-12-04 21:19:37 UTC (rev 13755)
@@ -57,11 +57,13 @@
 test_requires 'Test::More' => '0.88';
 
 # aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available
-if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.35_05')) {
-    author_requires('Test::Aggregate', '0.35_05');
+if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.364')) {
+    author_requires('Test::Aggregate', '0.364');
     author_requires('Test::Simple', '0.88');
+    open my $fh, '>', '.aggregating';
 }
 else {
+    unlink '.aggregating';
     tests join q{ },
         grep { $_ ne 't/aggregate.t' }
         map  { glob } qw[t/*.t t/aggregate/*.t];

Modified: Catalyst-Runtime/5.80/trunk/t/aggregate.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate.t	2010-12-04 12:49:53 UTC (rev 13754)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate.t	2010-12-04 21:19:37 UTC (rev 13755)
@@ -7,9 +7,9 @@
 use lib "$FindBin::Bin/lib";
 
 BEGIN {
-    unless (eval { require Test::Aggregate; Test::Aggregate->VERSION('0.35_05'); 1 }) {
+    unless (eval { require Test::Aggregate; Test::Aggregate->VERSION('0.364'); 1 }) {
         require Test::More;
-        Test::More::plan(skip_all => 'Test::Aggregate 0.35_05 required for test aggregation');
+        Test::More::plan(skip_all => 'Test::Aggregate 0.364 required for test aggregation');
     }
 }
 

Modified: Catalyst-Runtime/5.80/trunk/t/author/http-server.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/author/http-server.t	2010-12-04 12:49:53 UTC (rev 13754)
+++ Catalyst-Runtime/5.80/trunk/t/author/http-server.t	2010-12-04 21:19:37 UTC (rev 13755)
@@ -49,12 +49,14 @@
 # run the testsuite against the HTTP server
 $ENV{CATALYST_SERVER} = "http://localhost:$port";
 
+chdir '..';
+
 my $return;
 if ( $single_test ) {
-    $return = system( "$^X -I../lib/ $single_test" );
+    $return = system( "$^X -Ilib/ $single_test" );
 }
 else {
-    $return = prove( ['../lib/'], [glob('../t/aggregate/live_*.t')] );
+    $return = prove( ['lib/'], [grep { $_ ne '..' } glob('t/aggregate/live_*.t')] );
 }
 
 # shut it down
@@ -89,9 +91,16 @@
         unshift @INC, @{ $inc };
 
         require TAP::Harness;
-        my $harness = TAP::Harness->new;
-        my $aggregator = $harness->runtests(@{ $tests });
 
+        my $aggr = -e '.aggregating';
+        my $harness = TAP::Harness->new({
+            ($aggr ? (test_args => $tests) : ())
+        });
+
+        my $aggregator = $aggr
+            ? $harness->runtests('t/aggregate.t')
+            : $harness->runtests(@{ $tests });
+
         exit $aggregator->has_errors ? 1 : 0;
     } else {
         waitpid $pid, 0;




More information about the Catalyst-commits mailing list