summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-12-15 23:40:13 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-17 09:56:14 +0000
commit2e0f03802ba14b3313db31e232a4185e4ee8b77f (patch)
tree8c99a9e9bb52ac4d90d35120a1ad597c9ca611a2
parentbabd34dc43cb98c61c066c3a8434aab5a818845a (diff)
downloadpoky-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.bbclass2
-rw-r--r--meta/lib/oeqa/runtime/cases/rust.py19
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb3
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
66DEFAULT_TEST_SUITES = "${BASICTESTSUITE}" 66DEFAULT_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
5from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends
7from oeqa.runtime.decorator.package import OEHasPackage
8
9class 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"
25GOTOOLS:powerpc ?= "" 25GOTOOLS:powerpc ?= ""
26GOTOOLS:riscv32 ?= "" 26GOTOOLS:riscv32 ?= ""
27 27
28RUSTTOOLS ?= "rust-hello-world"
29
28GSTEXAMPLES ?= "gst-examples" 30GSTEXAMPLES ?= "gst-examples"
29GSTEXAMPLES:riscv64 = "" 31GSTEXAMPLES: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 "