mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 00:39:46 +00:00
oeqa/runtime/rust: Add basic compile/run test
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
eac47bff70
commit
79e57d41d2
@@ -0,0 +1,2 @@
|
|||||||
|
fn main() {
|
||||||
|
}
|
||||||
@@ -8,6 +8,30 @@ from oeqa.runtime.case import OERuntimeTestCase
|
|||||||
from oeqa.core.decorator.depends import OETestDepends
|
from oeqa.core.decorator.depends import OETestDepends
|
||||||
from oeqa.runtime.decorator.package import OEHasPackage
|
from oeqa.runtime.decorator.package import OEHasPackage
|
||||||
|
|
||||||
|
class RustCompileTest(OERuntimeTestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUp(cls):
|
||||||
|
dst = '/tmp/'
|
||||||
|
src = os.path.join(cls.tc.files_dir, 'test.rs')
|
||||||
|
cls.tc.target.copyTo(src, dst)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDown(cls):
|
||||||
|
files = '/tmp/test.rs /tmp/test'
|
||||||
|
cls.tc.target.run('rm %s' % files)
|
||||||
|
|
||||||
|
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||||
|
@OEHasPackage(['rust'])
|
||||||
|
def test_rust_compile(self):
|
||||||
|
status, output = self.target.run('rustc /tmp/test.rs -o /tmp/test')
|
||||||
|
msg = 'rust compile failed, output: %s' % output
|
||||||
|
self.assertEqual(status, 0, msg=msg)
|
||||||
|
|
||||||
|
status, output = self.target.run('/tmp/test')
|
||||||
|
msg = 'running compiled file failed, output: %s' % output
|
||||||
|
self.assertEqual(status, 0, msg=msg)
|
||||||
|
|
||||||
class RustHelloworldTest(OERuntimeTestCase):
|
class RustHelloworldTest(OERuntimeTestCase):
|
||||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||||
@OEHasPackage(['rust-hello-world'])
|
@OEHasPackage(['rust-hello-world'])
|
||||||
|
|||||||
Reference in New Issue
Block a user