X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flive%2Fcomponent%2Fcontroller%2Faction%2Fregexp.t;h=f67d0f9f1df1d40b0ca74eba2ef359cd561a2c6f;hp=ced2ac197faf2e0f70d520191537e4d22f210ba0;hb=587b0f5882d4f5e128ae082758da37b065a3efde;hpb=d8c66af52b5353c93b1816e19c0f1cac69bc5ad1 diff --git a/t/live/component/controller/action/regexp.t b/t/live/component/controller/action/regexp.t index ced2ac1..f67d0f9 100644 --- a/t/live/component/controller/action/regexp.t +++ b/t/live/component/controller/action/regexp.t @@ -6,10 +6,24 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 120; +our $iters; + +BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; } + +use Test::More tests => 12*$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 { { ok( my $response = request('http://localhost/action/regexp/10/hello'), 'Request' );