summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/files/test.rs2
-rw-r--r--meta/lib/oeqa/runtime/cases/rust.py24
2 files changed, 26 insertions, 0 deletions
diff --git a/meta/lib/oeqa/files/test.rs b/meta/lib/oeqa/files/test.rs
new file mode 100644
index 0000000000..f79c691f08
--- /dev/null
+++ b/meta/lib/oeqa/files/test.rs
@@ -0,0 +1,2 @@
1fn main() {
2}
diff --git a/meta/lib/oeqa/runtime/cases/rust.py b/meta/lib/oeqa/runtime/cases/rust.py
index 55b280d61d..186bb0d79e 100644
--- a/meta/lib/oeqa/runtime/cases/rust.py
+++ b/meta/lib/oeqa/runtime/cases/rust.py
@@ -8,6 +8,30 @@ from oeqa.runtime.case import OERuntimeTestCase
8from oeqa.core.decorator.depends import OETestDepends 8from oeqa.core.decorator.depends import OETestDepends
9from oeqa.runtime.decorator.package import OEHasPackage 9from oeqa.runtime.decorator.package import OEHasPackage
10 10
11class RustCompileTest(OERuntimeTestCase):
12
13 @classmethod
14 def setUp(cls):
15 dst = '/tmp/'
16 src = os.path.join(cls.tc.files_dir, 'test.rs')
17 cls.tc.target.copyTo(src, dst)
18
19 @classmethod
20 def tearDown(cls):
21 files = '/tmp/test.rs /tmp/test'
22 cls.tc.target.run('rm %s' % files)
23
24 @OETestDepends(['ssh.SSHTest.test_ssh'])
25 @OEHasPackage(['rust'])
26 def test_rust_compile(self):
27 status, output = self.target.run('rustc /tmp/test.rs -o /tmp/test')
28 msg = 'rust compile failed, output: %s' % output
29 self.assertEqual(status, 0, msg=msg)
30
31 status, output = self.target.run('/tmp/test')
32 msg = 'running compiled file failed, output: %s' % output
33 self.assertEqual(status, 0, msg=msg)
34
11class RustHelloworldTest(OERuntimeTestCase): 35class RustHelloworldTest(OERuntimeTestCase):
12 @OETestDepends(['ssh.SSHTest.test_ssh']) 36 @OETestDepends(['ssh.SSHTest.test_ssh'])
13 @OEHasPackage(['rust-hello-world']) 37 @OEHasPackage(['rust-hello-world'])