|
From: <sv...@va...> - 2006-05-26 00:13:30
|
Author: sewardj
Date: 2006-05-26 01:13:21 +0100 (Fri, 26 May 2006)
New Revision: 5931
Log:
Read extra args for all tests from $EXTRA_REGTEST_OPTS, which is=20
useful (eg) for running tests with --sanity-level=3D set. Print a
big warning before and after the tests if it is set.
Modified:
trunk/tests/vg_regtest.in
Modified: trunk/tests/vg_regtest.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tests/vg_regtest.in 2006-05-25 18:37:49 UTC (rev 5930)
+++ trunk/tests/vg_regtest.in 2006-05-26 00:13:21 UTC (rev 5931)
@@ -67,6 +67,12 @@
# If results don't match, the output can be found in <test>.std<strm>.ou=
t,
# and the diff between expected and actual in <test>.std<strm>.diff[0-9]=
*.
#
+# Sometimes it is useful to run all the tests at a high sanity check
+# level or with arbitrary other flags. To make this simple, extra=20
+# options, applied to all tests run, are read from $EXTRA_REGTEST_OPTS,
+# and handed to valgrind prior to any other flags specified by the=20
+# .vgtest file.
+#
# Notes on adding regression tests for a new tool are in
# coregrind/docs/coregrind_tools.html.
#-----------------------------------------------------------------------=
-----
@@ -272,6 +278,11 @@
my $name =3D $1;
my $fullname =3D "$dir/$name";=20
=20
+ # Pull any extra options (for example, --sanity-level=3D4)
+ # from $EXTRA_REGTEST_OPTS.
+ my $maybe_extraopts =3D $ENV{"EXTRA_REGTEST_OPTS"};
+ my $extraopts =3D $maybe_extraopts ? $maybe_extraopts : "";
+
read_vgtest_file($vgtest);
=20
if (defined $prereq) {
@@ -281,7 +292,7 @@
}
}
=20
- printf("%-16s valgrind $vgopts $prog $args\n", "$name:");
+ printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:");
=20
# Pass the appropriate --tool option for the directory (can be overr=
idden
# by an "args:" line, though). Set both VALGRIND_LIB and
@@ -290,7 +301,7 @@
my $tool=3Ddetermine_tool();
mysystem("VALGRIND_LIB=3D$tests_dir/.in_place VALGRIND_LIB_INNER=3D$=
tests_dir/.in_place "
. "$valgrind --command-line-only=3Dyes --memcheck:leak-check=3D=
no "
- . "--tool=3D$tool $vgopts "
+ . "--tool=3D$tool $extraopts $vgopts "
. "$prog $args > $name.stdout.out 2> $name.stderr.out");
=20
# Filter stdout
@@ -408,10 +419,22 @@
#-----------------------------------------------------------------------=
-----
# main(), sort of
#-----------------------------------------------------------------------=
-----
+sub warn_about_EXTRA_REGTEST_OPTS()
+{
+ print "WARNING: \$EXTRA_REGTEST_OPTS is set. You probably don't wan=
t\n";
+ print "to run the regression tests with it set, unless you are doing=
some\n";
+ print "strange experiment, and/or you really know what you are doing=
.\n";
+ print "\n";
+}
=20
# nuke VALGRIND_OPTS
$ENV{"VALGRIND_OPTS"} =3D "";
=20
+if ($ENV{"EXTRA_REGTEST_OPTS"}) {
+ print "\n";
+ warn_about_EXTRA_REGTEST_OPTS();
+}
+
my @fs =3D process_command_line();
foreach my $f (@fs) {
if (-d $f) {
@@ -434,6 +457,10 @@
}
summarise_results();
=20
+if ($ENV{"EXTRA_REGTEST_OPTS"}) {
+ warn_about_EXTRA_REGTEST_OPTS();
+}
+
if (0 =3D=3D $num_failures{"stdout"} &&
0 =3D=3D $num_failures{"stderr"} &&
0 =3D=3D $num_failures{"posttest"}) {
|