mirror of
https://git.yoctoproject.org/poky
synced 2026-03-19 13:49:41 +01:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
822f0c6512
commit
34fa9f0840
@@ -20,6 +20,8 @@ class RustCompileTest(OERuntimeTestCase):
|
||||
def tearDown(cls):
|
||||
files = '/tmp/test.rs /tmp/test'
|
||||
cls.tc.target.run('rm %s' % files)
|
||||
dirs = '/tmp/hello'
|
||||
cls.tc.target.run('rm -r %s' % dirs)
|
||||
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
@OEHasPackage(['rust'])
|
||||
@@ -32,6 +34,21 @@ class RustCompileTest(OERuntimeTestCase):
|
||||
msg = 'running compiled file failed, output: %s' % output
|
||||
self.assertEqual(status, 0, msg=msg)
|
||||
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
@OEHasPackage(['cargo'])
|
||||
def test_cargo_compile(self):
|
||||
status, output = self.target.run('cargo new /tmp/hello')
|
||||
msg = 'cargo new failed, output: %s' % output
|
||||
self.assertEqual(status, 0, msg=msg)
|
||||
|
||||
status, output = self.target.run('cargo build --manifest-path=/tmp/hello/Cargo.toml')
|
||||
msg = 'cargo build failed, output: %s' % output
|
||||
self.assertEqual(status, 0, msg=msg)
|
||||
|
||||
status, output = self.target.run('cargo run --manifest-path=/tmp/hello/Cargo.toml')
|
||||
msg = 'running compiled file failed, output: %s' % output
|
||||
self.assertEqual(status, 0, msg=msg)
|
||||
|
||||
class RustHelloworldTest(OERuntimeTestCase):
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
@OEHasPackage(['rust-hello-world'])
|
||||
|
||||
Reference in New Issue
Block a user