Revert "Add support for test.valgrind parallel testing"
authorKarl Williamson <public@khwilliamson.com>
Wed, 26 Mar 2014 18:23:33 +0000 (12:23 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 26 Mar 2014 18:37:55 +0000 (12:37 -0600)
This reverts commit f0aff2daa44923f600f6e1f2429a2add2214a9d5
"Add support for test.valgrind parallel testing"

This patch was accidentally pushed (by me); it breaks some things.  We
will wait to add this support until after 5.20

Makefile.SH
t/TEST
t/harness

index a032863..4b2ef00 100755 (executable)
@@ -1510,7 +1510,7 @@ test.valgrind check.valgrind:     test_prep
        @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
        @echo "And of course you have to have valgrind..."
        $(VALGRIND) $(VG_TEST) || exit 1
-       PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' TESTFILE=harness $(RUN_TESTS) choose
+       PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' $(RUN_TESTS) choose
 !NO!SUBS!
        ;;
 esac
diff --git a/t/TEST b/t/TEST
index 356bdc2..96eb6a4 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -284,15 +284,16 @@ sub _cmd {
         if ($ENV{PERL_VALGRIND}) {
             my $perl_supp = $options->{return_dir} ? "$options->{return_dir}/perl.supp" : "perl.supp";
             my $valgrind_exe = $ENV{VALGRIND} // 'valgrind';
-            if ($options->{run_dir}) {
-                $Valgrind_Log = "$options->{run_dir}/$Valgrind_Log";
-            }
             my $vg_opts = $ENV{VG_OPTS}
-              //   "--log-file=$Valgrind_Log "
+              // '--log-fd=3 '
                  . "--suppressions=$perl_supp --leak-check=yes "
                  . "--leak-resolution=high --show-reachable=yes "
-                 . "--num-callers=50 --track-origins=yes";
+                  . "--num-callers=50 --track-origins=yes";
             $perl = "$valgrind_exe $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}";
index 845b270..1ed70cb 100644 (file)
--- a/t/harness
+++ b/t/harness
@@ -16,7 +16,6 @@ use Config;
 
 $::do_nothing = $::do_nothing = 1;
 require './TEST';
-our $Valgrind_Log;
 
 my $Verbose = 0;
 $Verbose++ while @ARGV && $ARGV[0] eq '-v' && shift;
@@ -225,29 +224,10 @@ my $h = TAP::Harness->new({
            $options = $options{$test} = _scan_test($test, $type);
        }
 
-       (local $Valgrind_Log = "$test.valgrind-current") =~ s/^.*\///;
-
        return [ split ' ', _cmd($options, $type) ];
     },
 });
 
-# Print valgrind output after test completes
-if ($ENV{PERL_VALGRIND}) {
-    $h->callback(
-                after_test => sub {
-                    my ($job) = @_;
-                    my $test = $job->[0];
-                    my $vfile = "$test.valgrind-current";
-                    $vfile =~ s/^.*\///;
-
-                    open(my $voutput, '<', $vfile) or return;
-                    print "$test: Valgrind output:\n";
-                    print "$test: $_" for <$voutput>;
-                    close($voutput);
-                }
-                );
-}
-
 if ($state) {
     $h->callback(
                 after_test => sub {