Add tests for std usage. Closes #5097.

(cherry picked from commit 27ae70dfaa)
pull/5263/head
Jussi Pakkanen 6 years ago committed by John Ericson
parent af2d7af998
commit 82e36a6bfe
  1. 16
      run_unittests.py
  2. 2
      test cases/unit/50 std remains/meson.build
  3. 1
      test cases/unit/50 std remains/prog.c

@ -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())

@ -0,0 +1,2 @@
project('std_remains', 'c', default_options: ['c_std=c99'])
executable('prog', 'prog.c')

@ -0,0 +1 @@
int main(int argc, char **argv) { return 0; }
Loading…
Cancel
Save