|
From: Florian K. <fk...@so...> - 2026-03-04 22:25:05
|
https://sourceware.org/cgit/valgrind/commit/?id=980daf8169b059f9b78f8b3e4666a4eadf752be9 commit 980daf8169b059f9b78f8b3e4666a4eadf752be9 Author: Florian Krohm <fl...@ei...> Date: Wed Mar 4 22:23:18 2026 +0000 regtest: Support make regtest BUNSEN=no Inhibits the generation of .log and .trs files which are only of use for post-processing with bunsen. For those of us who like tidy working copies. vg_regtest: New command line option --no-bunsen Diff: --- Makefile.am | 13 ++++++++++--- NEWS | 3 +++ README_DEVELOPERS | 3 ++- tests/vg_regtest.in | 15 +++++++++++++-- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3f38a6ba35..674ad64469 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,6 +68,13 @@ pkgconfig_DATA = valgrind.pc BUILT_SOURCES = default.supp include/vgversion.h valgrind.pc CLEANFILES = default.supp +BUNSEN ?= yes + ifeq "$(BUNSEN)" "no" + VG_REGTEST_ARG ?= "--no-bunsen" + else + VG_REGTEST_ARG ?= + endif + default.supp: $(DEFAULT_SUPP_FILES) echo "# This is a generated file, composed of the following suppression rules:" > default.supp echo "# " $(DEFAULT_SUPP_FILES) >> default.supp @@ -76,7 +83,7 @@ default.supp: $(DEFAULT_SUPP_FILES) ## Ensure make exits with error if vg_regtest fails or post_regtest_checks fails. regtest: check $(top_srcdir)/gdbserver_tests/make_local_links $(GDB) - if tests/vg_regtest gdbserver_tests $(TOOLS) $(EXP_TOOLS) ; then \ + if tests/vg_regtest $(VG_REGTEST_ARG) gdbserver_tests $(TOOLS) $(EXP_TOOLS) ; then \ tests/post_regtest_checks $(abs_top_srcdir) gdbserver_tests $(TOOLS) $(EXP_TOOLS); \ else \ tests/post_regtest_checks $(abs_top_srcdir) gdbserver_tests $(TOOLS) $(EXP_TOOLS); \ @@ -85,9 +92,9 @@ regtest: check post-regtest-checks: tests/post_regtest_checks $(abs_top_srcdir) gdbserver_tests $(TOOLS) $(EXP_TOOLS) nonexp-regtest: check - tests/vg_regtest $(TOOLS) + tests/vg_regtest $(VG_REGTEST_ARG) $(TOOLS) exp-regtest: check - tests/vg_regtest gdbserver_tests $(EXP_TOOLS) + tests/vg_regtest $(VG_REGTEST_ARG) gdbserver_tests $(EXP_TOOLS) # Nb: gdbserver_tests are put in exp-regtest rather than nonexp-regtest # because they are tested with various valgrind tools, so might be using # an experimental tool. diff --git a/NEWS b/NEWS index 5bbbd812b0..25aa565101 100644 --- a/NEWS +++ b/NEWS @@ -125,6 +125,9 @@ X86/macOS 10.13, AMD64/macOS 10.13 and nanoMIPS/Linux. documentation. all, builds all documentation. html, builds HTML docs but skips building PDFs. See also README_DEVELOPERS. +* Control generation of files that are only useful for post-processing + with bunsen. make regtest BUNSEN=no inhibits generating those files. + * New VEX API function LibVEX_set_VexControl * The deprecated IROps: Iop_Clz32/64 and Iop_Ctz32/64 have been removed diff --git a/README_DEVELOPERS b/README_DEVELOPERS index 5d9fb823f9..286ed3b52c 100644 --- a/README_DEVELOPERS +++ b/README_DEVELOPERS @@ -68,7 +68,8 @@ files. These are listed, and non-passing tests detailed, in the test-suite-overall.log file. (Token *.trs and test-suite.log files are also created, for emulating automake-style testsuites, as expected by tools such as bunsen.) - +Generation of those files can be suppressed by specifying "BUNSEN=no" when +invoking make. Platform-specific setup for regression tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in index 6ef0b71071..2c4fe8c074 100644 --- a/tests/vg_regtest.in +++ b/tests/vg_regtest.in @@ -47,6 +47,7 @@ # --loop-till-fail: loops on the test(s) till one fail, then exit # This is useful to obtain detailed trace or --keep-unfiltered # output of a non deterministic test failure +# --no-bunsen: do not generate files for bunsen post-processing # # The easiest way is to run all tests in valgrind/ with (assuming you installed # in $PREFIX): @@ -140,7 +141,7 @@ my $usage="\n" . "Usage:\n" . " vg_regtest [--all, --valgrind, --valgrind-lib, --keep-unfiltered\n" . " --outer-valgrind, --outer-tool, --outer-args\n" - . " --loop-till-fail]\n" + . " --loop-till-fail --no-bunsen]\n" . " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n" . "\n"; @@ -174,6 +175,7 @@ my %num_failures = (stderr => 0, stdout => 0, stderrB => 0, stdoutB => 0, post => 0); my %num_results = (); +my $no_bunsen = 0; # Default valgrind to use is this build tree's (uninstalled) one my $valgrind = "./coregrind/valgrind"; @@ -252,6 +254,8 @@ sub process_command_line() $keepunfiltered = 1; } elsif ($arg =~ /^--loop-till-fail$/) { $looptillfail = 1; + } elsif ($arg =~ /^--no-bunsen$/) { + $no_bunsen = 1; } else { die $usage; } @@ -511,6 +515,7 @@ sub do_one_test($$) printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:"); print VGTESTLOG scalar localtime, " skipping, prereq failed\n"; close(VGTESTLOG); + unlink("$vgtest.log") if ($no_bunsen); return "SKIP"; } else { # Bad prereq; abort. @@ -692,6 +697,7 @@ sub do_one_test($$) close(VGTESTLOG); $num_tests_done++; + unlink("$vgtest.log") if ($no_bunsen); return $rc; } @@ -745,10 +751,11 @@ sub test_one_dir($$) print TSDIRLOG "See $tests_dir/test-suite-overall.log\n"; print TSDIRLOG " for overall results, including all non-PASS .log contents.\n"; close(TSDIRLOG); + unlink("test-suite.log") if ($no_bunsen); my $result = do_one_test($full_dir, $f); print TSLOG scalar localtime, " result: $result $full_dir/$f.log\n"; $num_results{$result} ++; - if ($result ne "PASS") { + if ($result ne "PASS" && $no_bunsen == 0) { # transcribe .log file into the overall log. open(LOGFILE, "< $f.log") || die "Cannot open $f.log"; while (<LOGFILE>) { print TSLOG "|\t$_"; } @@ -760,6 +767,7 @@ sub test_one_dir($$) print VGTESTTRS ":recheck: no\n"; # ? print VGTESTTRS ":copy-in-global-log: no\n"; # ? close(VGTESTTRS); + unlink ("$f.trs") if ($no_bunsen); } } if ($found_tests) { @@ -863,6 +871,7 @@ while (1) { # we will exit after one loop, unless looptillfail print VGTESTTRS ":recheck: no\n"; # ? print VGTESTTRS ":copy-in-global-log: no\n"; # ? close(VGTESTTRS); + unlink ("$f.trs") if ($no_bunsen); } chdir($tests_dir); } @@ -876,6 +885,8 @@ if ($ENV{"EXTRA_REGTEST_OPTS"}) { warn_about_EXTRA_REGTEST_OPTS(); } +unlink("test-suite-overall.log") if ($no_bunsen); + if (0 == $num_failures{"stdout"} && 0 == $num_failures{"stderr"} && 0 == $num_failures{"stdoutB"} && |