X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F20-bad.t;h=f36e2f5985b12060a2d7b4aaa937ea6781f10609;hb=d487631f95c032febc6d5ccad1a64b087e8b7184;hp=fbf33bf2c922dc73d538232f0e1e5866cbb5e059;hpb=b41c498738a3a4ccb8742883a42e6ea5addb1afd;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/t/20-bad.t b/t/20-bad.t index fbf33bf..f36e2f5 100644 --- a/t/20-bad.t +++ b/t/20-bad.t @@ -6,19 +6,26 @@ use warnings; use Test::More; use lib 't/lib'; -eval 'use Test::Valgrind action => q[Test::Valgrind::Test::Action]'; + +eval { + require Test::Valgrind; + Test::Valgrind->import( + action => 'Test::Valgrind::Test::Action', + ); +}; if ($@) { diag $@; - plan skip_all => 'Test::Valgrind is required to run test your distribution with valgrind'; + plan skip_all + => 'Test::Valgrind is required to test your distribution with valgrind'; } eval { require XSLoader; XSLoader::load('Test::Valgrind', $Test::Valgrind::VERSION); }; - -unless ($@) { - Test::Valgrind::leak(); -} else { +if ($@) { diag $@; +} else { + diag "leaking some bytes!"; + Test::Valgrind::leak(); }