This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Adjust 'make test.valgrind' to account for cpan/dist/ext separation.
authorGeorge Greer <perl@greerga.m-l.org>
Fri, 2 Jul 2010 22:50:12 +0000 (18:50 -0400)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Sat, 3 Jul 2010 06:53:23 +0000 (08:53 +0200)
Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
t/TEST
t/test.pl

diff --git a/t/TEST b/t/TEST
index 205a8aa..d4bf64c 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -91,7 +91,7 @@ if ($::do_nothing) {
 }
 
 # Location to put the Valgrind log.
-my $Valgrind_Log = 'current.valgrind';
+our $Valgrind_Log;
 
 $| = 1;
 
@@ -296,13 +296,17 @@ sub _cmd {
         my $redir = $^O eq 'VMS' ? '2>&1' : '';
 
         if ($ENV{PERL_VALGRIND}) {
+            my $perl_supp = $options->{return_dir} ? "$options->{return_dir}/perl.supp" : "perl.supp";
             my $valgrind = $ENV{VALGRIND} // 'valgrind';
             my $vg_opts = $ENV{VG_OPTS}
-              //  "--suppressions=perl.supp --leak-check=yes "
+              //  "--suppressions=$perl_supp --leak-check=yes "
                 . "--leak-resolution=high --show-reachable=yes "
-                  . "--num-callers=50";
+                  . "--num-callers=50 --track-origins=yes";
             $perl = "$valgrind --log-fd=3 $vg_opts $perl";
             $redir = "3>$Valgrind_Log";
+            if ($options->{run_dir}) {
+                $Valgrind_Log = "$options->{run_dir}/$Valgrind_Log";
+            }
         }
 
         my $args = "$options->{testswitch} $options->{switch} $options->{utf8}";
@@ -549,6 +553,7 @@ EOT
            $te = '';
        }
 
+        (local $Valgrind_Log = "$test.valgrind-current") =~ s/^.*\///;
        my $results = _run_test($test, $type);
 
        my $failure;
index 88e52ee..6109d8e 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -814,6 +814,9 @@ sub watchdog ($)
     my $timeout = shift;
     my $timeout_msg = 'Test process timed out - terminating';
 
+    # Valgrind slows perl way down so give it more time before dying.
+    $timeout *= 10 if $ENV{PERL_VALGRIND};
+
     my $pid_to_kill = $$;   # PID for this process
 
     # Don't use a watchdog process if 'threads' is loaded -