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.
pull/2803/head
Dylan Baker 7 years ago
parent 87742fd9f0
commit 0ec7dd5ac5
  1. 15
      run_project_tests.py
  2. 0
      test cases/objc/3 objc args/meson.build
  3. 0
      test cases/objc/3 objc args/prog.m
  4. 0
      test cases/objcpp/1 simple/meson.build
  5. 0
      test cases/objcpp/1 simple/prog.mm
  6. 0
      test cases/objcpp/2 objc++ args/meson.build
  7. 0
      test cases/objcpp/2 objc++ args/prog.mm

@ -447,20 +447,28 @@ def have_objc_compiler():
env = environment.Environment(None, build_dir, None, get_fake_options('/'), []) env = environment.Environment(None, build_dir, None, get_fake_options('/'), [])
try: try:
objc_comp = env.detect_objc_compiler(False) objc_comp = env.detect_objc_compiler(False)
except: except mesonlib.MesonException:
return False return False
if not objc_comp: if not objc_comp:
return False return False
try: try:
objc_comp.sanity_check(env.get_scratch_dir(), env) 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) objcpp_comp = env.detect_objcpp_compiler(False)
except: except mesonlib.MesonException:
return False return False
if not objcpp_comp: if not objcpp_comp:
return False return False
try: try:
objcpp_comp.sanity_check(env.get_scratch_dir(), env) objcpp_comp.sanity_check(env.get_scratch_dir(), env)
except: except mesonlib.MesonException:
return False return False
return True return True
@ -487,6 +495,7 @@ def detect_tests_to_run():
('rust', 'rust', backend is not Backend.ninja or not shutil.which('rustc')), ('rust', 'rust', backend is not Backend.ninja or not shutil.which('rustc')),
('d', 'd', backend is not Backend.ninja or not have_d_compiler()), ('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', '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')), ('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')), ('swift', 'swift', backend not in (Backend.ninja, Backend.xcode) or not shutil.which('swiftc')),
('python3', 'python3', backend is not Backend.ninja), ('python3', 'python3', backend is not Backend.ninja),

Loading…
Cancel
Save