X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Foptional_memleak.t;h=ca4cbcf2c6013d890f6fad11173de15c1cdcfb89;hp=391f031ac10e49bdd0b53a4a89ed4399a8feb154;hb=7064f69b1dfb59d1f3bad647b2097d0320acce8a;hpb=8c25d85b1c79a9671c0e81e65c5ff5c112e8399f diff --git a/t/optional_memleak.t b/t/optional_memleak.t index 391f031..ca4cbcf 100644 --- a/t/optional_memleak.t +++ b/t/optional_memleak.t @@ -1,23 +1,25 @@ -#!perl - use strict; use warnings; +use Test::More; +BEGIN { + plan skip_all => 'set TEST_MEMLEAK to enable this test' + unless $ENV{TEST_MEMLEAK}; +} + use FindBin; use lib "$FindBin::Bin/lib"; - -use Test::More; use Catalyst::Test 'TestApp'; -use YAML; -eval "use Proc::ProcessTable"; -plan skip_all => 'set TEST_MEMLEAK to enable this test' - unless $ENV{TEST_MEMLEAK}; +eval "use Proc::ProcessTable"; plan skip_all => 'Proc::ProcessTable required for this test' if $@; eval "use HTTP::Body 0.03"; plan skip_all => 'HTTP::Body >= 0.03 required for this test' if $@; +eval "use YAML"; +plan skip_all => 'YAML required for this test' if $@; + our $t = Proc::ProcessTable->new( cache_ttys => 1 ); our ( $initial, $final ) = ( 0, 0 ); our $tests = YAML::LoadFile("$FindBin::Bin/optional_stress.yml"); @@ -63,7 +65,7 @@ sub run_test { print "Final Size: $final\n"; if ( $final > $initial ) { - print "Leaked: " . ($final - $initial) . "\n"; + print "Leaked: " . ($final - $initial) . "K\n"; } is( $final, $initial, "'$uri' memory is not leaking" );