]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
vg_regtest: test-specific environment variables not reset between tests
authorMark Wielaard <mark@klomp.org>
Thu, 11 Feb 2021 17:29:52 +0000 (18:29 +0100)
committerMark Wielaard <mark@klomp.org>
Thu, 11 Feb 2021 17:41:11 +0000 (18:41 +0100)
Test-specific environment variables set in .vgtest files are not reset
between tests. This can result in tests running with environment variables
intended for a previously run test. This can be easily fixed by clearing
the @env and @envB arrays in tests/vg_regtest:read_vgtest_file()

Original patch by Aaron Merey <amerey@redhat.com>

https://bugs.kde.org/show_bug.cgi?id=432672

NEWS
tests/vg_regtest.in

diff --git a/NEWS b/NEWS
index cd372235f2bc011756f8253fc3533f9fa35e9feb..3e0f5a0bd33468504d68cdf284fec7e4834b139e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -87,6 +87,7 @@ n-i-bz  helgrind: If hg_cli__realloc fails, return NULL.
         diagnostics
 430354  ppc stxsibx and stxsihx instructions write too much data
 430485  expr_is_guardable doesn't handle Iex_Qop
+432672  vg_regtest: test-specific environment variables not reset between tests
 
 Release 3.16.1 (?? June 2020)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 5803b86f59f4ac32c41d2d2efbab5681c43b5645..c7cc60124b7849a1b94758415e20a641f94fb21c 100755 (executable)
@@ -300,9 +300,9 @@ sub read_vgtest_file($)
     my ($f) = @_;
 
     # Defaults.
-    ($vgopts, $prog, $args)            = ("", undef, "");
+    ($vgopts, $prog, $args, @env)      = ("", undef, "", ());
     ($stdout_filter, $stderr_filter)   = (undef, undef);
-    ($progB, $argsB, $stdinB)          = (undef, "", undef);
+    ($progB, $argsB, $stdinB, @envB)   = (undef, "", undef, ());
     ($stdoutB_filter, $stderrB_filter) = (undef, undef);
     ($prereq, $post, $cleanup)         = (undef, undef, undef);
     ($stdout_filter_args, $stderr_filter_args)   = (undef, undef);