From: Florian Ragwitz Date: Sat, 4 Dec 2010 21:19:37 +0000 (+0000) Subject: Aggregate http-server.t tests X-Git-Tag: 5.80030~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=e8e8895a9f69e9438fd2278db03e75fa303f7532;hp=ff9ac86d381410cde5fcdb946a1bfd16d9a41e2e 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. --- diff --git a/Makefile.PL b/Makefile.PL index fc26f97..8dbd962 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -57,11 +57,13 @@ test_requires 'Test::Exception'; 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]; diff --git a/t/aggregate.t b/t/aggregate.t index 660c5fe..6722046 100644 --- a/t/aggregate.t +++ b/t/aggregate.t @@ -7,9 +7,9 @@ use FindBin; 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'); } } diff --git a/t/author/http-server.t b/t/author/http-server.t index 13a548b..5bab59b 100644 --- a/t/author/http-server.t +++ b/t/author/http-server.t @@ -49,12 +49,14 @@ while ( check_port( 'localhost', $port ) != 1 ) { # 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,8 +91,15 @@ sub prove { 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 {