Add a test of add_languages(native:) introspection

If the meson.build doesn't use a native compiler, the native compiler
options (e.g. 'c_args') shouldn't be present in the output of 'meson
introspect --buildoptions'.
pull/7428/head
Jon Turney 4 years ago
parent d712c86a62
commit 461c14b8b7
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
  1. 8
      run_unittests.py
  2. 2
      test cases/unit/83 cross only introspect/meson.build

@ -4251,6 +4251,14 @@ recommended as it is not supported on some platforms''')
testdir = os.path.join(self.unit_test_dir, '59 introspect buildoptions')
self._run(self.mconf_command + [testdir])
def test_introspect_buildoptions_cross_only(self):
testdir = os.path.join(self.unit_test_dir, '83 cross only introspect')
testfile = os.path.join(testdir, 'meson.build')
res = self.introspect_directory(testfile, ['--buildoptions'] + self.meson_args)
optnames = [o['name'] for o in res]
self.assertIn('c_args', optnames)
self.assertNotIn('build.c_args', optnames)
def test_introspect_json_dump(self):
testdir = os.path.join(self.unit_test_dir, '57 introspection')
self.init(testdir)

@ -0,0 +1,2 @@
project('cross only introspect')
add_languages('c', native: false)
Loading…
Cancel
Save