summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2022-12-28 15:23:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-28 23:59:56 +0000
commit34fa9f08407b5ee711e0184a0efa2030c2592bf0 (patch)
treefe4c39acd16479fefe584d7206df93d9f69c807f /meta/lib
parent822f0c651241d95beb03ce410a8e3767e93af88e (diff)
downloadpoky-34fa9f08407b5ee711e0184a0efa2030c2592bf0.tar.gz
oeqa/runtime/rust: Add cargo test
(From OE-Core rev: f41a4e3d4c82b6332c5d52ad8fb38e32c7aee74b) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/runtime/cases/rust.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/rust.py b/meta/lib/oeqa/runtime/cases/rust.py
index 186bb0d79e..c9c60e16fd 100644
--- a/meta/lib/oeqa/runtime/cases/rust.py
+++ b/meta/lib/oeqa/runtime/cases/rust.py
@@ -20,6 +20,8 @@ class RustCompileTest(OERuntimeTestCase):
20 def tearDown(cls): 20 def tearDown(cls):
21 files = '/tmp/test.rs /tmp/test' 21 files = '/tmp/test.rs /tmp/test'
22 cls.tc.target.run('rm %s' % files) 22 cls.tc.target.run('rm %s' % files)
23 dirs = '/tmp/hello'
24 cls.tc.target.run('rm -r %s' % dirs)
23 25
24 @OETestDepends(['ssh.SSHTest.test_ssh']) 26 @OETestDepends(['ssh.SSHTest.test_ssh'])
25 @OEHasPackage(['rust']) 27 @OEHasPackage(['rust'])
@@ -32,6 +34,21 @@ class RustCompileTest(OERuntimeTestCase):
32 msg = 'running compiled file failed, output: %s' % output 34 msg = 'running compiled file failed, output: %s' % output
33 self.assertEqual(status, 0, msg=msg) 35 self.assertEqual(status, 0, msg=msg)
34 36
37 @OETestDepends(['ssh.SSHTest.test_ssh'])
38 @OEHasPackage(['cargo'])
39 def test_cargo_compile(self):
40 status, output = self.target.run('cargo new /tmp/hello')
41 msg = 'cargo new failed, output: %s' % output
42 self.assertEqual(status, 0, msg=msg)
43
44 status, output = self.target.run('cargo build --manifest-path=/tmp/hello/Cargo.toml')
45 msg = 'cargo build failed, output: %s' % output
46 self.assertEqual(status, 0, msg=msg)
47
48 status, output = self.target.run('cargo run --manifest-path=/tmp/hello/Cargo.toml')
49 msg = 'running compiled file failed, output: %s' % output
50 self.assertEqual(status, 0, msg=msg)
51
35class RustHelloworldTest(OERuntimeTestCase): 52class RustHelloworldTest(OERuntimeTestCase):
36 @OETestDepends(['ssh.SSHTest.test_ssh']) 53 @OETestDepends(['ssh.SSHTest.test_ssh'])
37 @OEHasPackage(['rust-hello-world']) 54 @OEHasPackage(['rust-hello-world'])