diff options
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/maturin.py')
-rw-r--r-- | meta/lib/oeqa/sdk/cases/maturin.py | 33 |
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 | |||
7 | import unittest | ||
8 | from oeqa.sdk.case import OESDKTestCase | ||
9 | |||
10 | from oeqa.utils.subprocesstweak import errors_have_output | ||
11 | |||
12 | errors_have_output() | ||
13 | |||
14 | |||
15 | class 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 | ) | ||