]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add --valgrind-lib, to complement --valgrind, to the regtests script
authorNicholas Nethercote <njn@valgrind.org>
Mon, 23 Oct 2006 18:38:35 +0000 (18:38 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Mon, 23 Oct 2006 18:38:35 +0000 (18:38 +0000)
(from Dave Nomura).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6338

tests/vg_regtest.in

index 8b035a258f6652ba5e66f3ab5466c847e9d7b7d8..f21c1c234d76078c991c49b327204f27a7a07511 100755 (executable)
 #
 # 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):
@@ -83,7 +88,7 @@ use strict;
 #----------------------------------------------------------------------------
 # Global vars
 #----------------------------------------------------------------------------
-my $usage="vg_regtest [--all, --valgrind]\n";
+my $usage="vg_regtest [--all, --valgrind, --valgrind-lib]\n";
 
 my $tmp="vg_regtest.tmp.$$";
 
@@ -107,6 +112,8 @@ my $valgrind = "./coregrind/valgrind";
 
 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";
 
@@ -152,6 +159,8 @@ sub process_command_line()
                 $alldirs = 1;
             } elsif ($arg =~ /^--valgrind=(.*)$/) {
                 $valgrind = $1;
+            } elsif ($arg =~ /^--valgrind-lib=(.*)$/) {
+                $valgrind_lib = $1;
             } else {
                 die $usage;
             }
@@ -299,7 +308,7 @@ sub do_one_test($$)
     # 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");