]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind.pm
Don't call dl_unload_file twice on the same libref
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind.pm
index c76231d07ba5dada26053ea4e75e9010c996dc98..d003528be0d3158d2efc541426d7547aa5d05f87 100644 (file)
@@ -18,11 +18,11 @@ Test::Valgrind - Test Perl code through valgrind.
 
 =head1 VERSION
 
-Version 0.06
+Version 0.07
 
 =cut
 
-our $VERSION = '0.06';
+our $VERSION = '0.07';
 
 =head1 SYNOPSIS
 
@@ -139,7 +139,8 @@ sub import {
   $callers = int $callers;
   my $vg = Test::Valgrind::Suppressions::VG_PATH;
   if (!$vg || !-x $vg) {
-   for (split /:/, $ENV{PATH}) {
+   require Config;
+   for (split /$Config::Config{path_sep}/, $ENV{PATH}) {
     $_ .= '/valgrind';
     if (-x) {
      $vg = $_;
@@ -230,15 +231,24 @@ sub import {
  }
 }
 
+END {
+ if ($run and eval { require DynaLoader; 1 }) {
+  for (@DynaLoader::dl_librefs) {
+   next unless defined;
+   undef $_ if DynaLoader::dl_unload_file($_);
+  }
+ }
+}
+
 =head1 CAVEATS
 
 You can't use this module to test code given by the C<-e> command-line switch.
 
-Results will most likely be better if your perl is built with debugging enabled. Using the latest valgrind available will also help.
+Perl 5.8 is notorious for leaking like there's no tomorrow, so the suppressions are very likely not to be very accurate on it. Anyhow, results will most likely be better if your perl is built with debugging enabled. Using the latest valgrind available will also help.
 
 This module is not really secure. It's definitely not taint safe. That shouldn't be a problem for test files.
 
-If your tests output to STDERR, everything will be eaten in the process. In particular, running this module against test files will obliterate their original test results.
+What your tests output to STDOUT is eaten unless you pass the C<diag> option, in which case it will be reprinted as diagnostics. STDERR is kept untouched.
 
 =head1 DEPENDENCIES
 
@@ -256,7 +266,7 @@ L<Devel::Leak>, L<Devel::LeakTrace>, L<Devel::LeakTrace::Fast>.
 
 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
 
-You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).
+You can contact me by mail or on C<irc.perl.org> (vincent).
 
 =head1 BUGS