diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-05-08 00:23:11 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-05-11 22:47:17 +0300 |
commit | c54dd63547b030e3d9feee694ec6f49c434f0df8 (patch) | |
tree | f759bd9c8ab64a0cdda5918ebc3a832e017027e4 /run_unittests.py | |
parent | 8f12102549348f3dd24d72633f3f8f82258e8a0a (diff) | |
download | meson-c54dd63547b030e3d9feee694ec6f49c434f0df8.zip meson-c54dd63547b030e3d9feee694ec6f49c434f0df8.tar.gz meson-c54dd63547b030e3d9feee694ec6f49c434f0df8.tar.bz2 |
Make objective C use C standard version. Closes #5495.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 89b00f6..256a408 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1723,6 +1723,9 @@ class BasePlatformTests(unittest.TestCase): self.unit_test_dir = os.path.join(src_root, 'test cases/unit') self.rewrite_test_dir = os.path.join(src_root, 'test cases/rewrite') self.linuxlike_test_dir = os.path.join(src_root, 'test cases/linuxlike') + self.objc_test_dir = os.path.join(src_root, 'test cases/objc') + self.objcpp_test_dir = os.path.join(src_root, 'test cases/objcpp') + # Misc stuff self.orig_env = os.environ.copy() if self.backend is Backend.ninja: @@ -6450,6 +6453,18 @@ class DarwinTests(BasePlatformTests): env = {'CFLAGS': '-L/tmp -L /var/tmp -headerpad_max_install_names -Wl,-export_dynamic -framework Foundation'} self.init(testdir, override_envvars=env) + def test_objc_versions(self): + # Objective-C always uses the C standard version. + # Objecttive-C++ always uses the C++ standard version. + # This is what most people seem to want and in addition + # it is the only setup supported by Xcode. + testdir = os.path.join(self.objc_test_dir, '1 simple') + self.init(testdir) + self.assertIn('-std=c99', self.get_compdb()[0]['command']) + self.wipe() + testdir = os.path.join(self.objcpp_test_dir, '1 simple') + self.init(testdir) + self.assertIn('-std=c++14', self.get_compdb()[0]['command']) @unittest.skipUnless(not is_windows(), "requires something Unix-like") class LinuxlikeTests(BasePlatformTests): |