#
# Options:
# --all: run tests in all subdirs
-# --valgrind: valgrind to use. Default is one built from this source tree.
+# --valgrind: valgrind launcher to use. Default is ./coregrind/valgrind.
+# (This option should probably only be used in conjunction with
+# --valgrind-lib.)
+# --valgrind-lib: valgrind libraries to use. Default is $tests_dir/.in_place.
+# (This option should probably only be used in conjunction with
+# --valgrind.)
#
# The easiest way is to run all tests in valgrind/ with (assuming you installed
# in $PREFIX):
#----------------------------------------------------------------------------
# Global vars
#----------------------------------------------------------------------------
-my $usage="vg_regtest [--all, --valgrind]\n";
+my $usage="vg_regtest [--all, --valgrind, --valgrind-lib]\n";
my $tmp="vg_regtest.tmp.$$";
chomp(my $tests_dir = `pwd`);
+my $valgrind_lib = "$tests_dir/.in_place";
+
# default filter is the one named "filter_stderr" in the test's directory
my $default_stderr_filter = "filter_stderr";
$alldirs = 1;
} elsif ($arg =~ /^--valgrind=(.*)$/) {
$valgrind = $1;
+ } elsif ($arg =~ /^--valgrind-lib=(.*)$/) {
+ $valgrind_lib = $1;
} else {
die $usage;
}
# VALGRIND_LIB_INNER in case this Valgrind was configured with
# --enable-inner.
my $tool=determine_tool();
- mysystem("VALGRIND_LIB=$tests_dir/.in_place VALGRIND_LIB_INNER=$tests_dir/.in_place "
+ mysystem("VALGRIND_LIB=$valgrind_lib VALGRIND_LIB_INNER=$valgrind_lib "
. "$valgrind --command-line-only=yes --memcheck:leak-check=no "
. "--tool=$tool $extraopts $vgopts "
. "$prog $args > $name.stdout.out 2> $name.stderr.out");