Use the harness instead of all of prove
[catagits/Catalyst-Runtime.git] / t / author / http-server.t
index d4a2183..13a548b 100644 (file)
@@ -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: $!";
 
@@ -54,7 +54,7 @@ if ( $single_test ) {
     $return = system( "$^X -I../lib/ $single_test" );
 }
 else {
-    $return = prove( '-r', '-I../lib/', glob('../t/aggregate/live_*.t') );
+    $return = prove( ['../lib/'], [glob('../t/aggregate/live_*.t')] );
 }
 
 # shut it down
@@ -84,11 +84,15 @@ sub check_port {
 }
 
 sub prove {
+    my ($inc, $tests) = @_;
     if (!(my $pid = fork)) {
-        require App::Prove;
-        my $prove = App::Prove->new;
-        $prove->process_args(@_);
-        exit( $prove->run ? 0 : 1 );
+        unshift @INC, @{ $inc };
+
+        require TAP::Harness;
+        my $harness = TAP::Harness->new;
+        my $aggregator = $harness->runtests(@{ $tests });
+
+        exit $aggregator->has_errors ? 1 : 0;
     } else {
         waitpid $pid, 0;
         return $?;