#
# The prerequisite command, if present, must return 0 otherwise the test is
# skipped.
+# 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
+# options, applied to all tests run, are read from $EXTRA_REGTEST_OPTS,
+# and handed to valgrind prior to any other flags specified by the
+# .vgperf file. Note: the env var is the same as vg_regtest.
#----------------------------------------------------------------------------
use warnings;
Any tools named in --tools must be present in all directories specified
with --vg. (This is not checked.)
+ Use EXTRA_REGTEST_OPTS to supply extra args for all tests
END
;
}
}
+ # Pull any extra options (for example, --sanity-level=4)
+ # from $EXTRA_REGTEST_OPTS.
+ my $maybe_extraopts = $ENV{"EXTRA_REGTEST_OPTS"};
+ my $extraopts = $maybe_extraopts ? $maybe_extraopts : "";
+
foreach my $vgdir (@vgdirs) {
# Benchmark name
printf("%-8s ", $name);
my $vgsetup = "";
my $vgcmd = "$vgdir/coregrind/valgrind "
- . "--command-line-only=yes --tool=$tool -q "
+ . "--command-line-only=yes --tool=$tool $extraopts -q "
. "--memcheck:leak-check=no "
. "--trace-children=yes "
. "$vgopts ";
#----------------------------------------------------------------------------
# main()
#----------------------------------------------------------------------------
+sub warn_about_EXTRA_REGTEST_OPTS()
+{
+ print "WARNING: \$EXTRA_REGTEST_OPTS is set. You probably don't want\n";
+ print "to run the perf 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";
+}
# nuke VALGRIND_OPTS
$ENV{"VALGRIND_OPTS"} = "";
+if ($ENV{"EXTRA_REGTEST_OPTS"}) {
+ print "\n";
+ warn_about_EXTRA_REGTEST_OPTS();
+}
+
my @fs = process_command_line();
foreach my $f (@fs) {
if (-d $f) {
}
summarise_results();
+if ($ENV{"EXTRA_REGTEST_OPTS"}) {
+ warn_about_EXTRA_REGTEST_OPTS();
+}
+
##--------------------------------------------------------------------##
##--- end ---##
##--------------------------------------------------------------------##