From: Vincent Pit Date: Fri, 30 Oct 2015 14:25:52 +0000 (-0200) Subject: Clean up tests X-Git-Tag: v1.15~12 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Valgrind.git;a=commitdiff_plain;h=d6ed05d0b24cd8815039e731d4b9ea69787f994e Clean up tests --- diff --git a/t/10-good.t b/t/10-good.t index d3ffb90..3552113 100644 --- a/t/10-good.t +++ b/t/10-good.t @@ -6,10 +6,15 @@ use warnings; use Test::More; use lib 't/lib'; -eval 'use Test::Valgrind'; + +eval { + require Test::Valgrind; + Test::Valgrind->import; +}; 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'; } { 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(); }