summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2023-12-16 21:41:32 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-17 19:07:22 +0000
commitb2b2e0277509a07a37022caf51f7e536adad898f (patch)
tree276f340778b9d1b4d47362fbf03699db1d188ed9 /meta/lib/oeqa/sdk
parent844e91049c814f574a6109f3fc82b0fa65e2be17 (diff)
downloadpoky-b2b2e0277509a07a37022caf51f7e536adad898f.tar.gz
oeqa: add simple 'maturin' SDK (testsdk) test case
We expect 'maturin' will be used in SDKs, so it makes sense to also test it in the testsdk environment. To run this test case, you can add the following to local.conf: TOOLCHAIN_HOST_TASK:append = " nativesdk-python3-maturin" And then build and test the SDK: bitbake -c populate_sdk core-image-full-cmdline bitbake -c testsdk core-image-full-cmdline You can substitute a different image recipe for "core-image-full-cmdline" (From OE-Core rev: 7ceff48625d01a0e60eb761a9a668d0c942cda89) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/sdk')
-rw-r--r--meta/lib/oeqa/sdk/cases/maturin.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/cases/maturin.py b/meta/lib/oeqa/sdk/cases/maturin.py
new file mode 100644
index 0000000000..14245bc36e
--- /dev/null
+++ b/meta/lib/oeqa/sdk/cases/maturin.py
@@ -0,0 +1,33 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7import unittest
8from oeqa.sdk.case import OESDKTestCase
9
10from oeqa.utils.subprocesstweak import errors_have_output
11
12errors_have_output()
13
14
15class MaturinTest(OESDKTestCase):
16 def setUp(self):
17 if not (
18 self.tc.hasHostPackage("nativesdk-python3-maturin")
19 or self.tc.hasHostPackage("python3-maturin-native")
20 ):
21 raise unittest.SkipTest("No python3-maturin package in the SDK")
22
23 def test_maturin_list_python(self):
24 py_major = self._run("python3 -c 'import sys; print(sys.version_info.major)'")
25 py_minor = self._run("python3 -c 'import sys; print(sys.version_info.minor)'")
26 python_version = "%s.%s" % (py_major.strip(), py_minor.strip())
27 cmd = "maturin list-python"
28 output = self._run(cmd)
29 self.assertRegex(output, r"^🐍 1 python interpreter found:\n")
30 self.assertRegex(
31 output,
32 r" - CPython %s (.+)/usr/bin/python%s$" % (python_version, python_version),
33 )