aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-06-18 12:10:55 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2019-06-23 16:50:24 +0300
commit9042130e9a990497c0e53a43d2750fb907507f09 (patch)
treee4c7805cffee9935c0f79eadaf630b54a2b9cd71 /run_unittests.py
parent80856884ccfb3f05afa35ba865c2464a464fd931 (diff)
downloadmeson-9042130e9a990497c0e53a43d2750fb907507f09.zip
meson-9042130e9a990497c0e53a43d2750fb907507f09.tar.gz
meson-9042130e9a990497c0e53a43d2750fb907507f09.tar.bz2
compilers: Fix bitcode and other options for objc code
We were setting the base options for the Objective-C compiler manually, due to which options such as b_bitcode and b_ndebug were not getting set at all. The base options here are the same as for C code with the Clang compiler, so just use the same inherited list. Also expand the bitcode test to ObjC and ObjC++ so this doesn't happen again.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 90d4a62..36f7f39 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -4093,18 +4093,21 @@ class DarwinTests(BasePlatformTests):
when it is false. This can't be an ordinary test case because we need
to inspect the compiler database.
'''
- testdir = os.path.join(self.common_test_dir, '4 shared')
- # Try with bitcode enabled
- out = self.init(testdir, extra_args='-Db_bitcode=true')
+ testdir = os.path.join(self.platform_test_dir, '7 bitcode')
env = get_fake_env(testdir, self.builddir, self.prefix)
cc = env.detect_c_compiler(MachineChoice.HOST)
if cc.id != 'clang':
raise unittest.SkipTest('Not using Clang on OSX')
+ # Try with bitcode enabled
+ out = self.init(testdir, extra_args='-Db_bitcode=true')
# Warning was printed
self.assertRegex(out, 'WARNING:.*b_bitcode')
# Compiler options were added
- compdb = self.get_compdb()
- self.assertIn('-fembed-bitcode', compdb[0]['command'])
+ for compdb in self.get_compdb():
+ if 'module' in compdb['file']:
+ self.assertNotIn('-fembed-bitcode', compdb['command'])
+ else:
+ self.assertIn('-fembed-bitcode', compdb['command'])
build_ninja = os.path.join(self.builddir, 'build.ninja')
# Linker options were added
with open(build_ninja, 'r', encoding='utf-8') as f:
@@ -4115,8 +4118,8 @@ class DarwinTests(BasePlatformTests):
self.setconf('-Db_bitcode=false')
# Regenerate build
self.build()
- compdb = self.get_compdb()
- self.assertNotIn('-fembed-bitcode', compdb[0]['command'])
+ for compdb in self.get_compdb():
+ self.assertNotIn('-fembed-bitcode', compdb['command'])
build_ninja = os.path.join(self.builddir, 'build.ninja')
with open(build_ninja, 'r', encoding='utf-8') as f:
contents = f.read()