aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-09-11 19:07:09 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-09-19 15:19:00 -0400
commit5bfab845d0bc2414e5323d2a59d6c357808c02ea (patch)
tree9941a3c2702cd542fb582d2e7426e788fbddfb6b /run_tests.py
parent0a9048e5546c17a926fd199ded798fba0f76b036 (diff)
downloadmeson-5bfab845d0bc2414e5323d2a59d6c357808c02ea.zip
meson-5bfab845d0bc2414e5323d2a59d6c357808c02ea.tar.gz
meson-5bfab845d0bc2414e5323d2a59d6c357808c02ea.tar.bz2
compilers: directly import from subpackages
It turns out we don't generally need to proxy every compiler ever through the top-level package. The number of times we directly poke at one is negligible and direct imports are pretty clean.
Diffstat (limited to 'run_tests.py')
-rwxr-xr-xrun_tests.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/run_tests.py b/run_tests.py
index fcd9337..ead5865 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -34,7 +34,8 @@ from pathlib import Path
from unittest import mock
import typing as T
-from mesonbuild import compilers
+from mesonbuild.compilers.c import CCompiler
+from mesonbuild.compilers.detect import detect_c_compiler
from mesonbuild import dependencies
from mesonbuild import mesonlib
from mesonbuild import mesonmain
@@ -160,7 +161,7 @@ def get_convincing_fake_env_and_cc(bdir, prefix):
Useful for running compiler checks in the unit tests.
'''
env = get_fake_env('', bdir, prefix)
- cc = compilers.detect_c_compiler(env, mesonlib.MachineChoice.HOST)
+ cc = detect_c_compiler(env, mesonlib.MachineChoice.HOST)
# Detect machine info
env.machines.host = detect_machine_info({'c':cc})
return (env, cc)
@@ -290,8 +291,8 @@ def run_mtest_inprocess(commandlist: T.List[str]) -> T.Tuple[int, str, str]:
return returncode, stdout.getvalue()
def clear_meson_configure_class_caches() -> None:
- compilers.CCompiler.find_library_cache = {}
- compilers.CCompiler.find_framework_cache = {}
+ CCompiler.find_library_cache = {}
+ CCompiler.find_framework_cache = {}
dependencies.PkgConfigDependency.pkgbin_cache = {}
dependencies.PkgConfigDependency.class_pkgbin = mesonlib.PerMachine(None, None)
mesonlib.project_meson_versions = collections.defaultdict(str)