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

Alexander Kanavin

Nice - but please find a different word than 'native', as this is
clearly a cross-binary testing with qemu usermode :)


On Fri, 18 Feb 2022 at 00:00, Jose Quaresma <quaresma.jose@...> wrote:

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
+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 ""}"

Join to automatically receive all group messages.