From: Andy Grundman Date: Wed, 26 Oct 2005 20:21:32 +0000 (+0000) Subject: Allow user-specified uri to test for leaks X-Git-Tag: 5.7099_04~1097 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=13af225cfa9d5a4529d7d77016b4562c7d5dc139 Allow user-specified uri to test for leaks --- 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 ); + } } }