]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - t/20-bad.t
Clean up tests
[perl/modules/Test-Valgrind.git] / t / 20-bad.t
index fbf33bf2c922dc73d538232f0e1e5866cbb5e059..490b779254f59ce56777c6f7a593b8dc03c739e6 100644 (file)
@@ -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();
 }