From 3997e8762ef057d1cb89c0d68d068a3aaf5e0450 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 29 Jan 2019 23:25:17 +0530 Subject: unit tests: Fix sdl2 failure test on macOS Also ensure that the test's no-pkg-config codepath will always be run, even on the CI where we always have pkg-config available. This counts as a test case for #4728 --- run_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'run_tests.py') diff --git a/run_tests.py b/run_tests.py index 7f85be6..2805375 100755 --- a/run_tests.py +++ b/run_tests.py @@ -213,6 +213,13 @@ def run_mtest_inprocess(commandlist): sys.stderr = old_stderr return returncode, mystdout.getvalue(), mystderr.getvalue() +def clear_meson_configure_class_caches(): + mesonbuild.compilers.CCompiler.library_dirs_cache = {} + mesonbuild.compilers.CCompiler.program_dirs_cache = {} + mesonbuild.compilers.CCompiler.find_library_cache = {} + mesonbuild.dependencies.PkgConfigDependency.pkgbin_cache = {} + mesonbuild.dependencies.PkgConfigDependency.class_pkgbin = mesonlib.PerMachine(None, None, None) + def run_configure_inprocess(commandlist): old_stdout = sys.stdout sys.stdout = mystdout = StringIO() @@ -223,6 +230,7 @@ def run_configure_inprocess(commandlist): finally: sys.stdout = old_stdout sys.stderr = old_stderr + clear_meson_configure_class_caches() return returncode, mystdout.getvalue(), mystderr.getvalue() def run_configure_external(full_command): -- cgit v1.1