From fe740681af91f127eae97d8af913eaedbc8e7ad3 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 15 Apr 2022 09:49:56 +1000 Subject: [PATCH] autotest: test_build_options.py: undef variables before setting them --- Tools/autotest/test_build_options.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/test_build_options.py b/Tools/autotest/test_build_options.py index b130ba3e52..c3ce942894 100755 --- a/Tools/autotest/test_build_options.py +++ b/Tools/autotest/test_build_options.py @@ -31,7 +31,10 @@ class TestBuildOptions(object): return mod.BUILD_OPTIONS def write_defines_to_file(self, defines, filepath): - content = "\n".join(["define %s %s" % (a, b) for (a, b) in defines.items()]) + lines = [] + lines.extend(["undef %s\n" % (a, ) for (a, b) in defines.items()]) + lines.extend(["define %s %s\n" % (a, b) for (a, b) in defines.items()]) + content = "".join(lines) with open(filepath, "w") as f: f.write(content)