summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.SH8
-rwxr-xr-xt/TEST7
2 files changed, 10 insertions, 5 deletions
diff --git a/Makefile.SH b/Makefile.SH
index 12555da8e3..f55271d593 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -255,6 +255,10 @@ LIB_EXT = $_a
OBJ_EXT = $_o
PATH_SEP = $p_
+# If you're going to use valgrind and it can't be invoked as plain valgrind
+# then you'll need to change this, or override it on the make command line.
+VALGRIND=valgrind
+
FIRSTMAKEFILE = $firstmakefile
# Any special object files needed by this architecture, e.g. os2/os2.obj
@@ -648,7 +652,7 @@ perl.valgrind.config: config.sh
@grep "^usemymalloc=" config.sh
@grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
@echo "And of course you have to have valgrind..."
- valgrind ./perl -e 1 2>/dev/null || exit 1
+ $(VALGRIND) ./perl -e 1 2>/dev/null || exit 1
# Third Degree Perl (Tru64 only)
@@ -1164,7 +1168,7 @@ test_prep.valgrind: test_prep perl.valgrind
PERL=./perl $(MAKE) _test_prep
test.valgrind check.valgrind: test_prep perl.valgrind.config
- PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 $(MAKE) _test
+ PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' $(MAKE) _test
utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind
PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 TEST_ARGS=-utf8 $(MAKE) _test
diff --git a/t/TEST b/t/TEST
index 4b963328f3..59c8fa5282 100755
--- a/t/TEST
+++ b/t/TEST
@@ -364,9 +364,10 @@ EOT
my $perl = $ENV{PERL} || './perl';
my $redir = $^O eq 'VMS' ? '2>&1' : '';
if ($ENV{PERL_VALGRIND}) {
- $perl = "valgrind --suppressions=perl.supp --leak-check=yes "
- . "--leak-resolution=high --show-reachable=yes "
- . "--num-callers=50 --logfile-fd=3 $perl";
+ my $valgrind = $ENV{VALGRIND} // 'valgrind';
+ $perl = "$valgrind --suppressions=perl.supp --leak-check=yes "
+ . "--leak-resolution=high --show-reachable=yes "
+ . "--num-callers=50 --logfile-fd=3 $perl";
$redir = "3>$valgrind_log";
}
my $run = "$perl" . _quote_args("$testswitch $switch $utf8")