summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-11-27 10:53:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-29 23:07:13 +0000
commit375c82ad0046eb3d0520cd8335e7472b45d13a48 (patch)
tree7fb92a8c8df9ce5b1aeb92494264a00f663f8e12
parent278cb0fc0725fbfdcafd3b3afcfb7c7c6a4eee14 (diff)
downloadpoky-375c82ad0046eb3d0520cd8335e7472b45d13a48.tar.gz
go-helloworld: test at runtime
This adds a smoke check for whether the Go toolchain actually produces working executables across a range of architectures. (From OE-Core rev: 2819bb2cf22c6cfcaeaee79f0280097ec9cb9327) 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/go.py19
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb7
3 files changed, 27 insertions, 1 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index e606de25fc..66de0e07c6 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" 64 dnf rpm opkg apt weston go"
65 65
66DEFAULT_TEST_SUITES = "${BASICTESTSUITE}" 66DEFAULT_TEST_SUITES = "${BASICTESTSUITE}"
67 67
diff --git a/meta/lib/oeqa/runtime/cases/go.py b/meta/lib/oeqa/runtime/cases/go.py
new file mode 100644
index 0000000000..89ba2c3ecb
--- /dev/null
+++ b/meta/lib/oeqa/runtime/cases/go.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 GoHelloworldTest(OERuntimeTestCase):
10 @OETestDepends(['ssh.SSHTest.test_ssh'])
11 @OEHasPackage(['go-helloworld'])
12 def test_gohelloworld(self):
13 cmd = "go-helloworld"
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, Go examples!", 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 94405fd8fe..e8f0811485 100644
--- a/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
@@ -18,6 +18,12 @@ KEXECTOOLS:nios2 ?= ""
18KEXECTOOLS:riscv64 ?= "" 18KEXECTOOLS:riscv64 ?= ""
19KEXECTOOLS:riscv32 ?= "" 19KEXECTOOLS:riscv32 ?= ""
20 20
21# go does not support ppc32, only ppc64
22# https://github.com/golang/go/issues/22885
23# gccgo may do better
24GOTOOLS ?= "go-helloworld"
25GOTOOLS:powerpc ?= ""
26
21GSTEXAMPLES ?= "gst-examples" 27GSTEXAMPLES ?= "gst-examples"
22GSTEXAMPLES:riscv64 = "" 28GSTEXAMPLES:riscv64 = ""
23 29
@@ -49,4 +55,5 @@ RDEPENDS:${PN} = "\
49 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', "${X11TOOLS}", "", d)} \ 55 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', "${X11TOOLS}", "", d)} \
50 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', "${X11GLTOOLS}", "", d)} \ 56 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', "${X11GLTOOLS}", "", d)} \
51 ${@bb.utils.contains('DISTRO_FEATURES', '3g', "${3GTOOLS}", "", d)} \ 57 ${@bb.utils.contains('DISTRO_FEATURES', '3g', "${3GTOOLS}", "", d)} \
58 ${GOTOOLS} \
52 " 59 "