summaryrefslogtreecommitdiff
path: root/unittests/allplatformstests.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-07-12 11:23:50 +0200
committerDylan Baker <dylan@pnwbakers.com>2025-07-14 10:26:46 -0700
commit1537a13d468aa7b49e7e0917be258e2e1a8b515f (patch)
tree2cacf1f1e9928d4222d2ff1e31b05128378efe06 /unittests/allplatformstests.py
parentbdabc2e5de8764521ded7e2e919a13e9e214757d (diff)
downloadmeson-1537a13d468aa7b49e7e0917be258e2e1a8b515f.tar.gz
unittests: add test case for setting and retrieving build options
Check that build options fall back to host options, and that they can be retrieved with get_option. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'unittests/allplatformstests.py')
-rw-r--r--unittests/allplatformstests.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 02001a471..905ae4d7b 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -3316,10 +3316,15 @@ class AllPlatformTests(BasePlatformTests):
def test_identity_cross(self):
testdir = os.path.join(self.unit_test_dir, '69 cross')
# Do a build to generate a cross file where the host is this target
- self.init(testdir, extra_args=['-Dgenerate=true'])
+ # build.c_args is ignored here.
+ self.init(testdir, extra_args=['-Dgenerate=true', '-Dc_args=-funroll-loops',
+ '-Dbuild.c_args=-pedantic'])
+ self.meson_native_files = [os.path.join(self.builddir, "nativefile")]
+ self.assertTrue(os.path.exists(self.meson_native_files[0]))
self.meson_cross_files = [os.path.join(self.builddir, "crossfile")]
self.assertTrue(os.path.exists(self.meson_cross_files[0]))
- # Now verify that this is detected as cross
+ # Now verify that this is detected as cross and build options are
+ # processed correctly
self.new_builddir()
self.init(testdir)