diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2017-03-27 15:15:19 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-05-13 23:34:27 +0300 |
commit | 076ce56425e37961e624d00364294a3617ad2e15 (patch) | |
tree | ba0595bb50cdf14f7c398cca591c585203183950 /run_project_tests.py | |
parent | 08bd92a6aedeb1375fece723cdafe16bd78fbc01 (diff) | |
download | meson-076ce56425e37961e624d00364294a3617ad2e15.zip meson-076ce56425e37961e624d00364294a3617ad2e15.tar.gz meson-076ce56425e37961e624d00364294a3617ad2e15.tar.bz2 |
Skip ObjectiveC/C++ tests if ObjC compiler is not available
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index b8ef0e9..ab8e3ae 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -34,6 +34,7 @@ import time import multiprocessing import concurrent.futures as conc import re +from run_unittests import get_fake_options from run_tests import get_backend_commands, get_backend_args_for_dir, Backend from run_tests import ensure_backend_detects_changes @@ -416,6 +417,25 @@ def have_d_compiler(): return True return False +def have_objc_compiler(): + with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: + env = environment.Environment(None, build_dir, None, get_fake_options('/'), []) + objc_comp = env.detect_objc_compiler(False) + if not objc_comp: + return False + try: + objc_comp.sanity_check(env.get_scratch_dir(), env) + except: + return False + objcpp_comp = env.detect_objc_compiler(False) + if not objcpp_comp: + return False + try: + objcpp_comp.sanity_check(env.get_scratch_dir(), env) + except: + return False + return True + def have_java(): if shutil.which('javac') and shutil.which('java'): return True @@ -440,7 +460,7 @@ def detect_tests_to_run(): ('vala', 'vala', backend is not Backend.ninja or not shutil.which('valac')), ('rust', 'rust', backend is not Backend.ninja or not shutil.which('rustc')), ('d', 'd', backend is not Backend.ninja or not have_d_compiler()), - ('objective c', 'objc', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows()), + ('objective c', 'objc', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objc_compiler()), ('fortran', 'fortran', backend is not Backend.ninja or not shutil.which('gfortran')), ('swift', 'swift', backend not in (Backend.ninja, Backend.xcode) or not shutil.which('swiftc')), ('python3', 'python3', backend is not Backend.ninja or not shutil.which('python3')), |