[RFC 1/2] meson.bbclass: add native meson test


Jose Quaresma
 

This patch add a task on the meson bbclass to add the
possibility to run the native test of the project using
the exe_wrapper.

This can be useful in some the integration processes
and add the possibility to run the test in an interactive
way using the devtool build for example.

There are two variable for that:
MESON_QEMU_WRAPPER_TEST_ENABLED: this enables the test when "1"
EXTRA_OEMESON_TEST: this is used to add extra args

Signed-off-by: Jose Quaresma <quaresma.jose@...>
---
meta/classes/meson.bbclass | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index 0bfe945811..2df7794f1d 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -179,3 +179,10 @@ meson_do_install() {
}

EXPORT_FUNCTIONS do_configure do_compile do_install
+
+EXTRA_OEMESON_TEST ?= ""
+MESON_QEMU_WRAPPER_RUNTEST = "${@d.getVar('MESON_QEMU_WRAPPER_TEST_ENABLED') == '1' and d.getVar('EXEWRAPPER_ENABLED') == 'True'}"
+meson_do_test() {
+ meson test -C ${B} --print-errorlogs ${EXTRA_OEMESON_TEST}
+}
+do_install[prefuncs] += "${@"meson_do_test" if d.getVar('MESON_QEMU_WRAPPER_RUNTEST') == 'True' else ""}"
--
2.35.1

Join openembedded-core@lists.openembedded.org to automatically receive all group messages.