diff options
| -rw-r--r-- | meta/lib/oeqa/runtime/cases/maturin.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/maturin.py b/meta/lib/oeqa/runtime/cases/maturin.py index b9a3b4acbc..4e6384fe5e 100644 --- a/meta/lib/oeqa/runtime/cases/maturin.py +++ b/meta/lib/oeqa/runtime/cases/maturin.py | |||
| @@ -10,6 +10,7 @@ from oeqa.runtime.case import OERuntimeTestCase | |||
| 10 | from oeqa.core.decorator.depends import OETestDepends | 10 | from oeqa.core.decorator.depends import OETestDepends |
| 11 | from oeqa.runtime.decorator.package import OEHasPackage | 11 | from oeqa.runtime.decorator.package import OEHasPackage |
| 12 | 12 | ||
| 13 | |||
| 13 | class MaturinTest(OERuntimeTestCase): | 14 | class MaturinTest(OERuntimeTestCase): |
| 14 | @OETestDepends(['ssh.SSHTest.test_ssh', 'python.PythonTest.test_python3']) | 15 | @OETestDepends(['ssh.SSHTest.test_ssh', 'python.PythonTest.test_python3']) |
| 15 | @OEHasPackage(['python3-maturin']) | 16 | @OEHasPackage(['python3-maturin']) |
| @@ -21,3 +22,37 @@ class MaturinTest(OERuntimeTestCase): | |||
| 21 | python_version = "%s.%s" % (py_major, py_minor) | 22 | python_version = "%s.%s" % (py_major, py_minor) |
| 22 | self.assertEqual(output, "🐍 1 python interpreter found:\n" | 23 | self.assertEqual(output, "🐍 1 python interpreter found:\n" |
| 23 | " - CPython %s at /usr/bin/python%s" % (python_version, python_version)) | 24 | " - CPython %s at /usr/bin/python%s" % (python_version, python_version)) |
| 25 | |||
| 26 | |||
| 27 | class MaturinDevelopTest(OERuntimeTestCase): | ||
| 28 | @classmethod | ||
| 29 | def setUp(cls): | ||
| 30 | dst = '/tmp' | ||
| 31 | src = os.path.join(cls.tc.files_dir, "maturin/guessing-game") | ||
| 32 | cls.tc.target.copyTo(src, dst) | ||
| 33 | |||
| 34 | @classmethod | ||
| 35 | def tearDown(cls): | ||
| 36 | cls.tc.target.run('rm -rf %s' % '/tmp/guessing-game/target') | ||
| 37 | |||
| 38 | @OETestDepends(['ssh.SSHTest.test_ssh', 'python.PythonTest.test_python3']) | ||
| 39 | @OEHasPackage(['python3-maturin']) | ||
| 40 | def test_maturin_develop(self): | ||
| 41 | """ | ||
| 42 | This test case requires: | ||
| 43 | (1) that a .venv can been created. | ||
| 44 | (2) DNS nameserver to resolve crate URIs for fetching | ||
| 45 | (3) a functional 'rustc' and 'cargo' | ||
| 46 | """ | ||
| 47 | targetdir = os.path.join("/tmp", "guessing-game") | ||
| 48 | self.target.run("cd %s; python3 -m venv .venv" % targetdir) | ||
| 49 | self.target.run("echo 'nameserver 8.8.8.8' > /etc/resolv.conf") | ||
| 50 | cmd = "cd %s; maturin develop" % targetdir | ||
| 51 | status, output = self.target.run(cmd) | ||
| 52 | self.assertRegex(output, r"🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.8") | ||
| 53 | self.assertRegex(output, r"🐍 Not using a specific python interpreter") | ||
| 54 | self.assertRegex(output, r"📡 Using build options features from pyproject.toml") | ||
| 55 | self.assertRegex(output, r"Compiling guessing-game v0.1.0") | ||
| 56 | self.assertRegex(output, r"📦 Built wheel for abi3 Python ≥ 3.8") | ||
| 57 | self.assertRegex(output, r"🛠 Installed guessing-game-0.1.0") | ||
| 58 | self.assertEqual(status, 0) | ||
