- Updates action tests to use CAT_BENCH_ITERS or 2 for num. iterations
[catagits/Catalyst-Runtime.git] / t / live / component / controller / action / index.t
index 6e44b21..a7136ec 100644 (file)
@@ -6,10 +6,24 @@ use warnings;
 use FindBin;
 use lib "$FindBin::Bin/../../../lib";
 
-use Test::More tests => 19;
+our $iters;
+
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+
+use Test::More tests => 19*$iters;
 use Catalyst::Test 'TestApp';
-    
-for ( 1 .. 1 ) {
+
+if ( $ENV{CAT_BENCHMARK} ) {
+    require Benchmark;
+    Benchmark::timethis( -$iters, \&run_tests );
+}
+else {
+    for ( 1 .. $iters ) {
+        run_tests();
+    }
+}
+
+sub run_tests {
     # test root index
     {
         ok( my $response = request('http://localhost/'), 'root index' );