Moved some PAR stuff
[catagits/Catalyst-Runtime.git] / t / live / component / controller / action / streaming.t
index 192e4de..c7e1c79 100644 (file)
@@ -6,11 +6,24 @@ use warnings;
 use FindBin;
 use lib "$FindBin::Bin/../../../lib";
 
-use Test::More tests => 80;
+our $iters;
+
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+
+use Test::More tests => 8*$iters;
 use Catalyst::Test 'TestApp';
 
-for ( 1 .. 10 ) {
+if ( $ENV{CAT_BENCHMARK} ) {
+    require Benchmark;
+    Benchmark::timethis( $iters, \&run_tests );
+}
+else {
+    for ( 1 .. $iters ) {
+        run_tests();
+    }
+}
 
+sub run_tests {
     # test direct streaming
     {
         ok( my $response = request('http://localhost/streaming'), 'Request' );