]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - t/30-bad.t
In t/30-bad.t, first load Test::Valgrind and then the XS code (whenever possible...
[perl/modules/Test-Valgrind.git] / t / 30-bad.t
index 4250639846c86dfe876be3116b13526d9e657d2c..f3313b06d04a5ea81fb35657dfe61e231a6d5669 100644 (file)
@@ -29,18 +29,20 @@ sub tester {
  return $passed;
 }
 
-eval "
- require XSLoader;
- XSLoader::load('Test::Valgrind', 0.06);
-";
+use lib qw{blib/archpub};
+eval 'use Test::Valgrind cb => \&tester';
 if ($@) {
- plan skip_all => "XS test code not available ($@)";
+ diag $@;
+ plan skip_all => 'Test::Valgrind is required to run test your distribution with valgrind';
 } else {
- use lib qw{blib/archpub};
- eval 'use Test::Valgrind cb => \&tester;';
+ eval "
+  use lib qw{blib/arch};
+  require XSLoader;
+  XSLoader::load('Test::Valgrind', \$Test::Valgrind::VERSION);
+ ";
  if ($@) {
   diag $@;
-  plan skip_all => 'Test::Valgrind is required to run test your distribution with valgrind';
+  plan skip_all => "XS test code not available";
  } else {
   Test::Valgrind::leak();
  }