aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-04-13 00:00:59 +0300
committerJohn Ericson <git@JohnEricson.me>2019-06-05 23:05:49 -0400
commit82e36a6bfe3c765e81438492bdff81e248f11c53 (patch)
tree60448fec666de91ecdbd6edf4f51674a35764b23 /run_unittests.py
parentaf2d7af9983a04fa2dd6c073bdc41847a23012c8 (diff)
downloadmeson-82e36a6bfe3c765e81438492bdff81e248f11c53.zip
meson-82e36a6bfe3c765e81438492bdff81e248f11c53.tar.gz
meson-82e36a6bfe3c765e81438492bdff81e248f11c53.tar.bz2
Add tests for std usage. Closes #5097.
(cherry picked from commit 27ae70dfaaff1298e68df70098acaa96f7ca748a)
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index ff623b9..0a13174 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -5198,6 +5198,14 @@ endian = 'little'
testdir = os.path.join(self.unit_test_dir, '55 pkg_config_path option')
self.init(testdir, extra_args=['-Dpkg_config_path=' + os.path.join(testdir, 'host_extra_path')])
+ def test_std_remains(self):
+ # C_std defined in project options must be in effect also when native compiling.
+ testdir = os.path.join(self.unit_test_dir, '50 std remains')
+ self.init(testdir)
+ compdb = self.get_compdb()
+ self.assertRegex(compdb[0]['command'], '-std=c99')
+ self.build()
+
def should_run_cross_arm_tests():
return shutil.which('arm-linux-gnueabihf-gcc') and not platform.machine().lower().startswith('arm')
@@ -5249,6 +5257,14 @@ class LinuxCrossArmTests(BasePlatformTests):
return
self.assertTrue(False, 'Option libdir not in introspect data.')
+ def test_std_remains(self):
+ # C_std defined in project options must be in effect also when cross compiling.
+ testdir = os.path.join(self.unit_test_dir, '50 std remains')
+ self.init(testdir)
+ compdb = self.get_compdb()
+ self.assertRegex(compdb[0]['command'], '-std=c99')
+ self.build()
+
def should_run_cross_mingw_tests():
return shutil.which('x86_64-w64-mingw32-gcc') and not (is_windows() or is_cygwin())