From 1a6d1e93099d3ffe6483f19ad6a0174c44e8e59b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 16 Aug 2021 11:20:00 -0700 Subject: [PATCH] util/xmlconfig: Make unit tests more resilient against user env settings Before this, setting 'vblank_mode=0' in the environment would cause a unit test to fail. Reviewed-by: Emma Anholt Part-of: --- src/util/tests/xmlconfig.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/util/tests/xmlconfig.cpp b/src/util/tests/xmlconfig.cpp index da6bab6fc1f..d35af035d5a 100644 --- a/src/util/tests/xmlconfig.cpp +++ b/src/util/tests/xmlconfig.cpp @@ -40,6 +40,19 @@ protected: xmlconfig_test::xmlconfig_test() { + /* Unset variables from the envrionment to prevent user settings from + * impacting the tests. + */ + unsetenv("glsl_zero_init"); + unsetenv("always_have_depth_buffer"); + unsetenv("opt"); + unsetenv("vblank_mode"); + unsetenv("not_present"); + unsetenv("mesa_b_option"); + unsetenv("mesa_s_option"); + unsetenv("mest_test_unknown_option"); + unsetenv("mest_drirc_option"); + options = {}; }