X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fauthor%2Fhttp-server.t;h=5f8a213a87c6b497e12153818370a6ecc657f4a7;hb=281521fc4f8e929e00196aac501429bb6eef02d6;hp=d4a218335b913ab919c192c3656d542b385f5495;hpb=8284c1699eab18fd858600a1f400d49c76ee9f5c;p=catagits%2FCatalyst-Runtime.git diff --git a/t/author/http-server.t b/t/author/http-server.t index d4a2183..5f8a213 100644 --- a/t/author/http-server.t +++ b/t/author/http-server.t @@ -32,7 +32,7 @@ rmtree '../t/tmp/TestApp/t' or die; # spawn the standalone HTTP server my $port = 30000 + int rand(1 + 10000); my @cmd = ($^X, "-I$FindBin::Bin/../../lib", - "$FindBin::Bin/../../t/tmp/TestApp/script/testapp_server.pl", '-port', $port ); + "$FindBin::Bin/../../t/tmp/TestApp/script/testapp_server.pl", '--port', $port ); my $pid = open3( undef, my $server, undef, @cmd) or die "Unable to spawn standalone HTTP server: $!"; @@ -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( '-r', '-I../lib/', glob('../t/aggregate/live_*.t') ); + $return = prove(grep { $_ ne '..' } glob('t/aggregate/live_*.t')); } # shut it down @@ -84,11 +86,21 @@ sub check_port { } sub prove { + my (@tests) = @_; if (!(my $pid = fork)) { - require App::Prove; - my $prove = App::Prove->new; - $prove->process_args(@_); - exit( $prove->run ? 0 : 1 ); + require TAP::Harness; + + my $aggr = -e '.aggregating'; + my $harness = TAP::Harness->new({ + ($aggr ? (test_args => \@tests) : ()), + lib => ['lib'], + }); + + my $aggregator = $aggr + ? $harness->runtests('t/aggregate.t') + : $harness->runtests(@tests); + + exit $aggregator->has_errors ? 1 : 0; } else { waitpid $pid, 0; return $?;