]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - gen.pl
Capture STDOUT so that its output doesn't mix with our test results
[perl/modules/Test-Valgrind.git] / gen.pl
diff --git a/gen.pl b/gen.pl
index 828a6b9279380589ced71dade59828d527b155de..9376b5c39f05d69fc084254ee32c3a4006d94c40 100755 (executable)
--- a/gen.pl
+++ b/gen.pl
@@ -1,28 +1,28 @@
-#!perl
-
 use strict;
 use warnings;
 
 use Test::More;
-eval <<'EOD';
-use Test::Valgrind
- diag    => 1,
- no_test => 1,
- no_supp => 1,
- callers => 50,
- extra   => [ qw/--show-reachable=yes --gen-suppressions=all/ ]
-EOD
+eval {
+ use Test::Valgrind
 diag    => 1,
 no_test => 1,
 no_supp => 1,
 callers => 50,
+  extra   => [ qw/--show-reachable=yes --gen-suppressions=all/ ];
+};
 if ($@) {
  plan skip_all => 'Test::Valgrind is required to run test your distribution with valgrind';
 } else {
- eval {
+ eval "
+  use lib qw{blib/arch};
   require XSLoader;
-  XSLoader::load('Test::Valgrind', $Test::Valgrind::VERSION);
};
+  XSLoader::load('Test::Valgrind', \$Test::Valgrind::VERSION);
";
  unless ($@) {
   Test::Valgrind::notleak("valgrind it!");
+ } else {
+  diag $@;
  }
 }
 
 1;
-