diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2021-12-15 23:40:13 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-17 09:56:14 +0000 |
commit | 2e0f03802ba14b3313db31e232a4185e4ee8b77f (patch) | |
tree | 8c99a9e9bb52ac4d90d35120a1ad597c9ca611a2 | |
parent | babd34dc43cb98c61c066c3a8434aab5a818845a (diff) | |
download | poky-2e0f03802ba14b3313db31e232a4185e4ee8b77f.tar.gz |
rust-hello-world: test at runtime
This adds a smoke check for whether the rust toolchain actually
produces working executables across a range of architectures.
(From OE-Core rev: 14bb638b0df7acfa6aa89abf4625357f8cde886b)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/testimage.bbclass | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/runtime/cases/rust.py | 19 | ||||
-rw-r--r-- | meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb | 3 |
3 files changed, 23 insertions, 1 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index 66de0e07c6..1c5fd4ee6a 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass | |||
@@ -61,7 +61,7 @@ BASICTESTSUITE = "\ | |||
61 | ping date df ssh scp python perl gi ptest parselogs \ | 61 | ping date df ssh scp python perl gi ptest parselogs \ |
62 | logrotate connman systemd oe_syslog pam stap ldd xorg \ | 62 | logrotate connman systemd oe_syslog pam stap ldd xorg \ |
63 | kernelmodule gcc buildcpio buildlzip buildgalculator \ | 63 | kernelmodule gcc buildcpio buildlzip buildgalculator \ |
64 | dnf rpm opkg apt weston go" | 64 | dnf rpm opkg apt weston go rust" |
65 | 65 | ||
66 | DEFAULT_TEST_SUITES = "${BASICTESTSUITE}" | 66 | DEFAULT_TEST_SUITES = "${BASICTESTSUITE}" |
67 | 67 | ||
diff --git a/meta/lib/oeqa/runtime/cases/rust.py b/meta/lib/oeqa/runtime/cases/rust.py new file mode 100644 index 0000000000..b3d6cf7f37 --- /dev/null +++ b/meta/lib/oeqa/runtime/cases/rust.py | |||
@@ -0,0 +1,19 @@ | |||
1 | # | ||
2 | # SPDX-License-Identifier: MIT | ||
3 | # | ||
4 | |||
5 | from oeqa.runtime.case import OERuntimeTestCase | ||
6 | from oeqa.core.decorator.depends import OETestDepends | ||
7 | from oeqa.runtime.decorator.package import OEHasPackage | ||
8 | |||
9 | class RustHelloworldTest(OERuntimeTestCase): | ||
10 | @OETestDepends(['ssh.SSHTest.test_ssh']) | ||
11 | @OEHasPackage(['rust-hello-world']) | ||
12 | def test_rusthelloworld(self): | ||
13 | cmd = "rust-hello-world" | ||
14 | status, output = self.target.run(cmd) | ||
15 | msg = 'Exit status was not 0. Output: %s' % output | ||
16 | self.assertEqual(status, 0, msg=msg) | ||
17 | |||
18 | msg = 'Incorrect output: %s' % output | ||
19 | self.assertEqual(output, "Hello, world!", msg=msg) | ||
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb index 1fee1c925d..e05e329020 100644 --- a/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb +++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb | |||
@@ -25,6 +25,8 @@ GOTOOLS ?= "go-helloworld" | |||
25 | GOTOOLS:powerpc ?= "" | 25 | GOTOOLS:powerpc ?= "" |
26 | GOTOOLS:riscv32 ?= "" | 26 | GOTOOLS:riscv32 ?= "" |
27 | 27 | ||
28 | RUSTTOOLS ?= "rust-hello-world" | ||
29 | |||
28 | GSTEXAMPLES ?= "gst-examples" | 30 | GSTEXAMPLES ?= "gst-examples" |
29 | GSTEXAMPLES:riscv64 = "" | 31 | GSTEXAMPLES:riscv64 = "" |
30 | 32 | ||
@@ -57,4 +59,5 @@ RDEPENDS:${PN} = "\ | |||
57 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', "${X11GLTOOLS}", "", d)} \ | 59 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', "${X11GLTOOLS}", "", d)} \ |
58 | ${@bb.utils.contains('DISTRO_FEATURES', '3g', "${3GTOOLS}", "", d)} \ | 60 | ${@bb.utils.contains('DISTRO_FEATURES', '3g', "${3GTOOLS}", "", d)} \ |
59 | ${GOTOOLS} \ | 61 | ${GOTOOLS} \ |
62 | ${RUSTTOOLS} \ | ||
60 | " | 63 | " |