summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk
diff options
context:
space:
mode:
authorSean Nyekjaer <sean@geanix.com>2023-10-09 12:51:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-19 13:38:56 +0100
commit96310a58672e86b4130866c41b64525a2f9532da (patch)
tree018cd02cc4e75f797fc4da669e4c52a70772ac79 /meta/lib/oeqa/sdk
parent1a44c1ad599385be2d503897add9480c29f32e05 (diff)
downloadpoky-96310a58672e86b4130866c41b64525a2f9532da.tar.gz
oeqa/sdk/rust: Add build and run test of rust binary with SDK host
Add a QA test to the SDK to test that a basic cargo build works for the SDK host. (From OE-Core rev: 7f05760debd3aeb69c3294f3ceb92d4f1aceec1f) Signed-off-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.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/rust.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/cases/rust.py b/meta/lib/oeqa/sdk/cases/rust.py
index 31036f0f14..f5d437bb19 100644
--- a/meta/lib/oeqa/sdk/cases/rust.py
+++ b/meta/lib/oeqa/sdk/cases/rust.py
@@ -33,3 +33,25 @@ class RustCompileTest(OESDKTestCase):
33 33
34 def test_cargo_build(self): 34 def test_cargo_build(self):
35 self._run('cd %s/hello; cargo build' % self.tc.sdk_dir) 35 self._run('cd %s/hello; cargo build' % self.tc.sdk_dir)
36
37class RustHostCompileTest(OESDKTestCase):
38 td_vars = ['MACHINE', 'SDK_SYS']
39
40 @classmethod
41 def setUpClass(self):
42 targetdir = os.path.join(self.tc.sdk_dir, "hello")
43 try:
44 shutil.rmtree(targetdir)
45 except FileNotFoundError:
46 pass
47 shutil.copytree(os.path.join(self.tc.sdk_files_dir, "rust/hello"), targetdir)
48
49 def setUp(self):
50 machine = self.td.get("MACHINE")
51 if not self.tc.hasHostPackage("packagegroup-rust-cross-canadian-%s" % machine):
52 raise unittest.SkipTest("RustCompileTest class: SDK doesn't contain a Rust cross-canadian toolchain")
53
54 def test_cargo_build(self):
55 sdksys = self.td.get("SDK_SYS")
56 self._run('cd %s/hello; cargo build --target %s-gnu' % (self.tc.sdk_dir, sdksys))
57 self._run('cd %s/hello; cargo run --target %s-gnu' % (self.tc.sdk_dir, sdksys))