|
From: Tom H. <th...@cy...> - 2005-02-13 12:18:47
|
CVS commit by thughes:
Add a --command-line-only switch and make the test driver use it to
ensure that the user's .valgrindrc and/or the VALGRIND_OPTS environment
variable can't affect the tests.
M +11 -1 coregrind/vg_main.c 1.249
M +1 -1 tests/vg_regtest.in 1.29
--- valgrind/coregrind/vg_main.c #1.248:1.249
@@ -642,4 +642,6 @@ static void get_command_line( int argc,
} else {
+ Bool augment = True;
+
/* Count the arguments on the command line. */
vg_argv0 = argv;
@@ -652,4 +654,8 @@ static void get_command_line( int argc,
break;
}
+ if (VG_CLO_STREQ(argv[vg_argc0], "--command-line-only=yes"))
+ augment = False;
+ else if (VG_CLO_STREQ(argv[vg_argc0], "--command-line-only=no"))
+ augment = True;
}
cl_argv = &argv[vg_argc0];
@@ -658,4 +664,5 @@ static void get_command_line( int argc,
Note we don't do this if getting args from VALGRINDCLO, as
those extra args will already be present in VALGRINDCLO. */
+ if (augment)
augment_command_line(&vg_argc0, &vg_argv0);
}
@@ -1476,4 +1483,5 @@ void usage ( Bool debug_help )
" --weird-hacks=hack1,hack2,... recognised hacks: lax-ioctls,ioctl-mmap [none]\n"
" --pointercheck=no|yes enforce client address space limits [yes]\n"
+" --command-line-only=no|yes only use command line options [no]\n"
"\n"
" user options for Valgrind tools that report errors:\n"
@@ -1643,4 +1651,6 @@ static void process_cmd_line_options( UI
if (VG_CLO_STREQN(7, arg, "--exec="))
continue;
+ if (VG_CLO_STREQN(20, arg, "--command-line-only="))
+ continue;
if ( VG_CLO_STREQ(arg, "--"))
--- valgrind/tests/vg_regtest.in #1.28:1.29
@@ -283,5 +283,5 @@
# by an "args:" or "args.dev:" line, though).
my $tool=determine_tool();
- mysystem("VALGRINDLIB=$tests_dir/.in_place $valgrind --tool=$tool $vgopts $prog $args > $name.stdout.out 2> $name.stderr.out");
+ mysystem("VALGRINDLIB=$tests_dir/.in_place $valgrind --command-line-only=yes --tool=$tool $vgopts $prog $args > $name.stdout.out 2> $name.stderr.out");
if (defined $stdout_filter) {
|