X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Valgrind.git;a=blobdiff_plain;f=t%2F20-bad.t;h=490b779254f59ce56777c6f7a593b8dc03c739e6;hp=fbf33bf2c922dc73d538232f0e1e5866cbb5e059;hb=d6ed05d0b24cd8815039e731d4b9ea69787f994e;hpb=bca85461fd8f34e21d6b1f4deb8b313c3771880d diff --git a/t/20-bad.t b/t/20-bad.t index fbf33bf..490b779 100644 --- a/t/20-bad.t +++ b/t/20-bad.t @@ -6,19 +6,23 @@ 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 { + Test::Valgrind::leak(); }