diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-12-19 21:10:52 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-01-06 13:49:34 -0800 |
commit | 0ec7dd5ac53b0a6955ecce65c011a5d06631bd94 (patch) | |
tree | 7f4566fcd01c8ad27a4b78fb5eaf23409bf7dde0 /run_project_tests.py | |
parent | 87742fd9f016873fcd9d91ef8bc4c3b1be925224 (diff) | |
download | meson-0ec7dd5ac53b0a6955ecce65c011a5d06631bd94.zip meson-0ec7dd5ac53b0a6955ecce65c011a5d06631bd94.tar.gz meson-0ec7dd5ac53b0a6955ecce65c011a5d06631bd94.tar.bz2 |
tests: Split objc and objc++ tests
This allows platforms that can compile one or the other (but not both)
to run the tests that they can.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 810f00e..68d2de5 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -447,20 +447,28 @@ def have_objc_compiler(): env = environment.Environment(None, build_dir, None, get_fake_options('/'), []) try: objc_comp = env.detect_objc_compiler(False) - except: + except mesonlib.MesonException: return False if not objc_comp: return False try: objc_comp.sanity_check(env.get_scratch_dir(), env) + except mesonlib.MesonException: + return False + return True + +def have_objcpp_compiler(): + with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: + env = environment.Environment(None, build_dir, None, get_fake_options('/'), []) + try: objcpp_comp = env.detect_objcpp_compiler(False) - except: + except mesonlib.MesonException: return False if not objcpp_comp: return False try: objcpp_comp.sanity_check(env.get_scratch_dir(), env) - except: + except mesonlib.MesonException: return False return True @@ -487,6 +495,7 @@ def detect_tests_to_run(): ('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() or not have_objc_compiler()), + ('objective c++', 'objcpp', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objcpp_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), |