From 6c8fe83bb5d1aaa11307253e8ab33c2d7f1a4a3f Mon Sep 17 00:00:00 2001 From: Thomas Roos Date: Wed, 17 May 2023 14:13:53 +0200 Subject: oeqa: adding selftest-hello and use it to speed up tests Adding a selftest version of hello world to run it in tests where no download is necessary. Also using this in several tests to speed them up. Using the -native version wherever possible will also speed up tests a lot. [YOCTO #11142] (From OE-Core rev: c3f26b63934888df0e3cd563c1c2804eb78a368e) Signed-off-by: Thomas Roos Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- .../recipes-test/selftest-hello/files/helloworld.c | 8 ++++++++ .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 meta-selftest/recipes-test/selftest-hello/files/helloworld.c create mode 100644 meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb (limited to 'meta-selftest') diff --git a/meta-selftest/recipes-test/selftest-hello/files/helloworld.c b/meta-selftest/recipes-test/selftest-hello/files/helloworld.c new file mode 100644 index 0000000000..fc7169b7b8 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-hello/files/helloworld.c @@ -0,0 +1,8 @@ +#include + +int main(void) +{ + printf("Hello world!\n"); + + return 0; +} diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb new file mode 100644 index 0000000000..547587bef4 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb @@ -0,0 +1,19 @@ +DESCRIPTION = "Simple helloworld application -- selftest variant" +SECTION = "examples" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "file://helloworld.c" + +S = "${WORKDIR}" + +do_compile() { + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld +} + +do_install() { + install -d ${D}${bindir} + install -m 0755 helloworld ${D}${bindir} +} + +BBCLASSEXTEND = "native nativesdk" \ No newline at end of file -- cgit v1.2.3-54-g00ecf