X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Foptional%2Fmemleak.t;h=0a9fbe1f2edefe3181472a8307d0fe47cf3bb4fe;hp=d5de6ff86d39ce37ecc0222bfc2e8e7d95856c84;hb=13af225cfa9d5a4529d7d77016b4562c7d5dc139;hpb=010c814d7378030f1255c2cd038653d34074ecd6 diff --git a/t/optional/memleak.t b/t/optional/memleak.t index d5de6ff..0a9fbe1 100644 --- a/t/optional/memleak.t +++ b/t/optional/memleak.t @@ -20,12 +20,22 @@ our ( $initial, $final ) = ( 0, 0 ); our $tests = YAML::LoadFile("$FindBin::Bin/stress.yml"); my $total_tests = 0; -map { $total_tests += scalar @{ $tests->{$_} } } keys %{$tests}; -plan tests => $total_tests; -foreach my $test_group ( keys %{$tests} ) { - foreach my $test ( @{ $tests->{$test_group} } ) { - run_test( $test ); +# let the user specify a single uri to test +my $user_test = shift; +if ( $user_test ) { + plan tests => 1; + run_test( $user_test ); +} +# otherwise, run all tests +else { + map { $total_tests += scalar @{ $tests->{$_} } } keys %{$tests}; + plan tests => $total_tests; + + foreach my $test_group ( keys %{$tests} ) { + foreach my $test ( @{ $tests->{$test_group} } ) { + run_test( $test ); + } } }