diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-09-08 16:45:07 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-09-09 15:06:02 +0100 |
commit | 461c14b8b77abe3ef4802880c2b736ea2419961f (patch) | |
tree | c9cde4160fb800ff3ae4d054a37f67c3ab7da687 | |
parent | d712c86a623ed11d7c2918d8161fdf76ff4586f2 (diff) | |
download | meson-461c14b8b77abe3ef4802880c2b736ea2419961f.zip meson-461c14b8b77abe3ef4802880c2b736ea2419961f.tar.gz meson-461c14b8b77abe3ef4802880c2b736ea2419961f.tar.bz2 |
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'.
-rwxr-xr-x | run_unittests.py | 8 | ||||
-rw-r--r-- | test cases/unit/83 cross only introspect/meson.build | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 2510fce..efe1e29 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -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) diff --git a/test cases/unit/83 cross only introspect/meson.build b/test cases/unit/83 cross only introspect/meson.build new file mode 100644 index 0000000..ed25441 --- /dev/null +++ b/test cases/unit/83 cross only introspect/meson.build @@ -0,0 +1,2 @@ +project('cross only introspect') +add_languages('c', native: false) |