summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrun_unittests.py4
-rw-r--r--test cases/unit/51 std remains/meson.build8
2 files changed, 12 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 0ca7067bc..5727def62 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -3717,6 +3717,8 @@ recommended as it is not supported on some platforms''')
for idx, i in enumerate(res1):
if i['name'] == 'cpp_std':
res1[idx]['value'] = 'c++14'
+ if i['name'] == 'build.cpp_std':
+ res1[idx]['value'] = 'c++14'
if i['name'] == 'buildtype':
res1[idx]['value'] = 'release'
if i['name'] == 'optimization':
@@ -5389,7 +5391,9 @@ endian = 'little'
testdir = os.path.join(self.unit_test_dir, '51 std remains')
self.init(testdir)
compdb = self.get_compdb()
+ self.assertEqual(len(compdb), 2)
self.assertRegex(compdb[0]['command'], '-std=c99')
+ self.assertRegex(compdb[1]['command'], '-std=c99')
self.build()
def test_identity_cross(self):
diff --git a/test cases/unit/51 std remains/meson.build b/test cases/unit/51 std remains/meson.build
index ac6f9e247..e192d7c68 100644
--- a/test cases/unit/51 std remains/meson.build
+++ b/test cases/unit/51 std remains/meson.build
@@ -1,2 +1,10 @@
project('std_remains', 'c', default_options: ['c_std=c99'])
+
executable('prog', 'prog.c')
+
+# Check that native: true does not affect the use of c_std in
+# non-cross builds
+
+if not meson.is_cross_build()
+ executable('prog2', 'prog.c', native: true)
+endif