All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 1/2] meson.bbclass: add native meson test
@ 2022-02-17 23:00 Jose Quaresma
  2022-02-17 23:00 ` [RFC 2/2] gstreamer1.0: add support for running native test Jose Quaresma
  2022-02-18  6:58 ` [OE-core] [RFC 1/2] meson.bbclass: add native meson test Alexander Kanavin
  0 siblings, 2 replies; 5+ messages in thread
From: Jose Quaresma @ 2022-02-17 23:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: 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@gmail.com>
---
 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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC 2/2] gstreamer1.0: add support for running native test
  2022-02-17 23:00 [RFC 1/2] meson.bbclass: add native meson test Jose Quaresma
@ 2022-02-17 23:00 ` Jose Quaresma
  2022-02-18  6:57   ` [OE-core] " Alexander Kanavin
  2022-02-18  6:58 ` [OE-core] [RFC 1/2] meson.bbclass: add native meson test Alexander Kanavin
  1 sibling, 1 reply; 5+ messages in thread
From: Jose Quaresma @ 2022-02-17 23:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jose Quaresma

This is an exmple of using the native meson test

gstreamer1.0-meson-qemuwrapper-test.inc
^ this is receipe part

meson-qemuwrapper-helper.sh
^ this is an helper script to skip unsupported tests

meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
^ this patch helps debugind unsupported tests

With EXTRA_OEMESON_TEST = "gst_gstbin" it will only run
the gst_gstbin test and the output
is the following

+ meson_do_test
+ export GST_DEBUG=6
+ meson test -C /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build --print-errorlogs gst_gstbin

ninja: Entering directory `/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build'

ninja: no work to do.

1/1 gst_gstbin TIMEOUT        180.12s   killed by signal 15 SIGTERM

>>> GST_PLUGIN_SCANNER_1_0=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/libs/gst/helpers/gst-plugin-scanner GST_PLUGIN_LOADING_WHITELIST=gstreamer GST_STATE_IGNORE_ELEMENTS='' MESON_EXE_WRAPPER=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/meson-qemuwrapper GST_PLUGIN_PATH_1_0=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build MALLOC_PERTURB_=192 GST_REGISTRY=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/tests/check/gst_gstbin.registry CK_DEFAULT_TIMEOUT=20 GST_PLUGIN_SYSTEM_PATH_1_0='' /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/meson-qemuwrapper /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/tests/check/gst_gstbin
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
Listing only the last 100 lines from a long log.
0:00:07.719379569 440069   0x4000025400 DEBUG             GST_STATES gstbin.c:2990:gst_bin_change_state_func:<bin0> iterator done
0:00:07.719393717 440069   0x4000061180 LOG              GST_MESSAGE gstmessage.c:304:gst_message_new_custom: source fakesink0: creating new message 0x400c002100 latency
0:00:07.719413507 440069   0x4000025400 LOG               GST_STATES gstelement.c:3282:gst_element_change_state_func:<bin0> default handler tries setting state from PLAYING to PAUSED (0023)
0:00:07.719438100 440069   0x4000061180 DEBUG                GST_BUS gstbus.c:338:gst_bus_post:<bus0> [msg 0x400c002100] posting on bus latency message: 0x400c002100, time 99:99:99.999999999, seq-num 31, element 'fakesink0', (NULL)
0:00:07.719441024 440069   0x4000025400 DEBUG             GST_STATES gstbin.c:3006:gst_bin_change_state_func:<bin0> we have ASYNC elements SUCCESS -> ASYNC
0:00:07.719467032 440069   0x4000025400 DEBUG                    bin gstbin.c:2383:gst_bin_sort_iterator_free:<bin0>
.
.
.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Summary of Failures:

1/1 gst_gstbin TIMEOUT        180.12s   killed by signal 15 SIGTERM

Ok:                 0
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            1

Full log written to /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/meson-logs/testlog.txt

+ bb_sh_exit_handler

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
 .../gstreamer1.0-meson-qemuwrapper-test.inc   | 15 ++++++
 ...show-the-reason-when-spawning-of-gst.patch | 53 +++++++++++++++++++
 .../gstreamer1.0/meson-qemuwrapper-helper.sh  | 15 ++++++
 .../gstreamer/gstreamer1.0_1.20.0.bb          |  6 +++
 4 files changed, 89 insertions(+)
 create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
 create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
 create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
new file mode 100644
index 0000000000..c9f4885f82
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
@@ -0,0 +1,15 @@
+SRC_URI += "file://0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch;striplevel=3"
+SRC_URI += "file://meson-qemuwrapper-helper.sh"
+
+#MESON_QEMU_WRAPPER_HELPER = "${WORKDIR}/meson-qemuwrapper-helper.sh"
+
+PACKAGECONFIG[tests] = "-Dtests=enabled,-Dtests=disabled"
+
+# run single test
+EXTRA_OEMESON_TEST = "gst_gstbin"
+
+meson_do_test:prepend() {
+    # run the test with the debug mode enabled
+    # logs will be placed at build/meson-logs/testlog.txt
+    export GST_DEBUG=6
+}
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
new file mode 100644
index 0000000000..22c8750f5b
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
@@ -0,0 +1,53 @@
+From 8e1de3f84c2e654515b6d6b16783a4a08dfd118d Mon Sep 17 00:00:00 2001
+From: Jose Quaresma <quaresma.jose@gmail.com>
+Date: Wed, 8 Dec 2021 22:13:15 +0000
+Subject: [PATCH] gstpluginloader: show the reason when spawning of
+ gst-plugin-scanner fail
+
+This fix helps in cross compiling when the meson tests runs using a qemu wraper
+
+Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1701>
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/8e1de3f84c2e654515b6d6b16783a4a08dfd118d]
+
+Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
+---
+ subprojects/gstreamer/gst/gstpluginloader.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/subprojects/gstreamer/gst/gstpluginloader.c b/subprojects/gstreamer/gst/gstpluginloader.c
+index 10a446fa5e..fb8b45cffa 100644
+--- a/subprojects/gstreamer/gst/gstpluginloader.c
++++ b/subprojects/gstreamer/gst/gstpluginloader.c
+@@ -413,6 +413,7 @@ gst_plugin_loader_try_helper (GstPluginLoader * loader, gchar * location)
+ {
+   char *argv[6] = { NULL, };
+   int c = 0;
++  GError *error = NULL;
+ 
+ #if defined (__APPLE__) && defined (USR_BIN_ARCH_SWITCH)
+   if (gst_plugin_loader_use_usr_bin_arch ()) {
+@@ -432,11 +433,16 @@ gst_plugin_loader_try_helper (GstPluginLoader * loader, gchar * location)
+     GST_LOG ("Trying to spawn gst-plugin-scanner helper at %s", location);
+   }
+ 
+-  if (!g_spawn_async_with_pipes (NULL, argv, NULL,
+-          G_SPAWN_DO_NOT_REAP_CHILD /* | G_SPAWN_STDERR_TO_DEV_NULL */ ,
+-          NULL, NULL, &loader->child_pid, &loader->fd_w.fd, &loader->fd_r.fd,
+-          NULL, NULL))
++  g_spawn_async_with_pipes (NULL, argv, NULL,
++      G_SPAWN_DO_NOT_REAP_CHILD /* | G_SPAWN_STDERR_TO_DEV_NULL */ ,
++      NULL, NULL, &loader->child_pid, &loader->fd_w.fd, &loader->fd_r.fd,
++      NULL, &error);
++
++  if (error) {
++    GST_ERROR ("Spawning gst-plugin-scanner helper failed: %s", error->message);
++    g_clear_error (&error);
+     return FALSE;
++  }
+ 
+   gst_poll_add_fd (loader->fdset, &loader->fd_w);
+   gst_poll_add_fd (loader->fdset, &loader->fd_r);
+-- 
+2.35.1
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh b/meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh
new file mode 100644
index 0000000000..7f03f79292
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+#set -x
+
+test="$(basename "$1")"
+
+# some tests currently fails so there we skipped the already knowns
+skipped="$skipped elements_dataurisrc"
+skipped="$skipped libs_gstnettimeprovider"
+skipped="$skipped gst_gstelement"
+skipped="$skipped gst_gstregistry"
+for s in $skipped; do
+    if [ "$s" = "$test" ]; then
+        exit 77
+    fi
+done
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
index 243f99fee9..38595b8789 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
@@ -70,3 +70,9 @@ FILES:${PN}-dbg += "${datadir}/gdb ${datadir}/gstreamer-1.0/gdb"
 CVE_PRODUCT = "gstreamer"
 
 PTEST_BUILD_HOST_FILES = ""
+
+MESON_QEMU_WRAPPER_TEST_ENABLED = "1"
+
+GST_MESON_TEST = "${@"gstreamer1.0-meson-qemuwrapper-test.inc" if d.getVar('MESON_QEMU_WRAPPER_TEST_ENABLED') == '1' else ""}"
+
+require ${GST_MESON_TEST}
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [RFC 2/2] gstreamer1.0: add support for running native test
  2022-02-17 23:00 ` [RFC 2/2] gstreamer1.0: add support for running native test Jose Quaresma
@ 2022-02-18  6:57   ` Alexander Kanavin
  2022-02-20  0:20     ` Jose Quaresma
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Kanavin @ 2022-02-18  6:57 UTC (permalink / raw)
  To: Jose Quaresma; +Cc: OE-core

I like the idea, but gstreamer build-time testing seems like a bit of
a work in progress. Is there some other meson-based component where
this can be showcased and enabled in a more simple way?

Alex

On Fri, 18 Feb 2022 at 00:00, Jose Quaresma <quaresma.jose@gmail.com> wrote:
>
> This is an exmple of using the native meson test
>
> gstreamer1.0-meson-qemuwrapper-test.inc
> ^ this is receipe part
>
> meson-qemuwrapper-helper.sh
> ^ this is an helper script to skip unsupported tests
>
> meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
> ^ this patch helps debugind unsupported tests
>
> With EXTRA_OEMESON_TEST = "gst_gstbin" it will only run
> the gst_gstbin test and the output
> is the following
>
> + meson_do_test
> + export GST_DEBUG=6
> + meson test -C /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build --print-errorlogs gst_gstbin
>
> ninja: Entering directory `/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build'
>
> ninja: no work to do.
>
> 1/1 gst_gstbin TIMEOUT        180.12s   killed by signal 15 SIGTERM
>
> >>> GST_PLUGIN_SCANNER_1_0=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/libs/gst/helpers/gst-plugin-scanner GST_PLUGIN_LOADING_WHITELIST=gstreamer GST_STATE_IGNORE_ELEMENTS='' MESON_EXE_WRAPPER=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/meson-qemuwrapper GST_PLUGIN_PATH_1_0=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build MALLOC_PERTURB_=192 GST_REGISTRY=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/tests/check/gst_gstbin.registry CK_DEFAULT_TIMEOUT=20 GST_PLUGIN_SYSTEM_PATH_1_0='' /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/meson-qemuwrapper /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/tests/check/gst_gstbin
> ――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
> Listing only the last 100 lines from a long log.
> 0:00:07.719379569 440069   0x4000025400 DEBUG             GST_STATES gstbin.c:2990:gst_bin_change_state_func:<bin0> iterator done
> 0:00:07.719393717 440069   0x4000061180 LOG              GST_MESSAGE gstmessage.c:304:gst_message_new_custom: source fakesink0: creating new message 0x400c002100 latency
> 0:00:07.719413507 440069   0x4000025400 LOG               GST_STATES gstelement.c:3282:gst_element_change_state_func:<bin0> default handler tries setting state from PLAYING to PAUSED (0023)
> 0:00:07.719438100 440069   0x4000061180 DEBUG                GST_BUS gstbus.c:338:gst_bus_post:<bus0> [msg 0x400c002100] posting on bus latency message: 0x400c002100, time 99:99:99.999999999, seq-num 31, element 'fakesink0', (NULL)
> 0:00:07.719441024 440069   0x4000025400 DEBUG             GST_STATES gstbin.c:3006:gst_bin_change_state_func:<bin0> we have ASYNC elements SUCCESS -> ASYNC
> 0:00:07.719467032 440069   0x4000025400 DEBUG                    bin gstbin.c:2383:gst_bin_sort_iterator_free:<bin0>
> .
> .
> .
> ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
> Summary of Failures:
>
> 1/1 gst_gstbin TIMEOUT        180.12s   killed by signal 15 SIGTERM
>
> Ok:                 0
> Expected Fail:      0
> Fail:               0
> Unexpected Pass:    0
> Skipped:            0
> Timeout:            1
>
> Full log written to /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/meson-logs/testlog.txt
>
> + bb_sh_exit_handler
>
> Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> ---
>  .../gstreamer1.0-meson-qemuwrapper-test.inc   | 15 ++++++
>  ...show-the-reason-when-spawning-of-gst.patch | 53 +++++++++++++++++++
>  .../gstreamer1.0/meson-qemuwrapper-helper.sh  | 15 ++++++
>  .../gstreamer/gstreamer1.0_1.20.0.bb          |  6 +++
>  4 files changed, 89 insertions(+)
>  create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
>  create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
>  create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh
>
> diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
> new file mode 100644
> index 0000000000..c9f4885f82
> --- /dev/null
> +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
> @@ -0,0 +1,15 @@
> +SRC_URI += "file://0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch;striplevel=3"
> +SRC_URI += "file://meson-qemuwrapper-helper.sh"
> +
> +#MESON_QEMU_WRAPPER_HELPER = "${WORKDIR}/meson-qemuwrapper-helper.sh"
> +
> +PACKAGECONFIG[tests] = "-Dtests=enabled,-Dtests=disabled"
> +
> +# run single test
> +EXTRA_OEMESON_TEST = "gst_gstbin"
> +
> +meson_do_test:prepend() {
> +    # run the test with the debug mode enabled
> +    # logs will be placed at build/meson-logs/testlog.txt
> +    export GST_DEBUG=6
> +}
> diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
> new file mode 100644
> index 0000000000..22c8750f5b
> --- /dev/null
> +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
> @@ -0,0 +1,53 @@
> +From 8e1de3f84c2e654515b6d6b16783a4a08dfd118d Mon Sep 17 00:00:00 2001
> +From: Jose Quaresma <quaresma.jose@gmail.com>
> +Date: Wed, 8 Dec 2021 22:13:15 +0000
> +Subject: [PATCH] gstpluginloader: show the reason when spawning of
> + gst-plugin-scanner fail
> +
> +This fix helps in cross compiling when the meson tests runs using a qemu wraper
> +
> +Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1701>
> +
> +Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/8e1de3f84c2e654515b6d6b16783a4a08dfd118d]
> +
> +Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> +---
> + subprojects/gstreamer/gst/gstpluginloader.c | 14 ++++++++++----
> + 1 file changed, 10 insertions(+), 4 deletions(-)
> +
> +diff --git a/subprojects/gstreamer/gst/gstpluginloader.c b/subprojects/gstreamer/gst/gstpluginloader.c
> +index 10a446fa5e..fb8b45cffa 100644
> +--- a/subprojects/gstreamer/gst/gstpluginloader.c
> ++++ b/subprojects/gstreamer/gst/gstpluginloader.c
> +@@ -413,6 +413,7 @@ gst_plugin_loader_try_helper (GstPluginLoader * loader, gchar * location)
> + {
> +   char *argv[6] = { NULL, };
> +   int c = 0;
> ++  GError *error = NULL;
> +
> + #if defined (__APPLE__) && defined (USR_BIN_ARCH_SWITCH)
> +   if (gst_plugin_loader_use_usr_bin_arch ()) {
> +@@ -432,11 +433,16 @@ gst_plugin_loader_try_helper (GstPluginLoader * loader, gchar * location)
> +     GST_LOG ("Trying to spawn gst-plugin-scanner helper at %s", location);
> +   }
> +
> +-  if (!g_spawn_async_with_pipes (NULL, argv, NULL,
> +-          G_SPAWN_DO_NOT_REAP_CHILD /* | G_SPAWN_STDERR_TO_DEV_NULL */ ,
> +-          NULL, NULL, &loader->child_pid, &loader->fd_w.fd, &loader->fd_r.fd,
> +-          NULL, NULL))
> ++  g_spawn_async_with_pipes (NULL, argv, NULL,
> ++      G_SPAWN_DO_NOT_REAP_CHILD /* | G_SPAWN_STDERR_TO_DEV_NULL */ ,
> ++      NULL, NULL, &loader->child_pid, &loader->fd_w.fd, &loader->fd_r.fd,
> ++      NULL, &error);
> ++
> ++  if (error) {
> ++    GST_ERROR ("Spawning gst-plugin-scanner helper failed: %s", error->message);
> ++    g_clear_error (&error);
> +     return FALSE;
> ++  }
> +
> +   gst_poll_add_fd (loader->fdset, &loader->fd_w);
> +   gst_poll_add_fd (loader->fdset, &loader->fd_r);
> +--
> +2.35.1
> +
> diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh b/meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh
> new file mode 100644
> index 0000000000..7f03f79292
> --- /dev/null
> +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +#set -x
> +
> +test="$(basename "$1")"
> +
> +# some tests currently fails so there we skipped the already knowns
> +skipped="$skipped elements_dataurisrc"
> +skipped="$skipped libs_gstnettimeprovider"
> +skipped="$skipped gst_gstelement"
> +skipped="$skipped gst_gstregistry"
> +for s in $skipped; do
> +    if [ "$s" = "$test" ]; then
> +        exit 77
> +    fi
> +done
> diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
> index 243f99fee9..38595b8789 100644
> --- a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
> +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
> @@ -70,3 +70,9 @@ FILES:${PN}-dbg += "${datadir}/gdb ${datadir}/gstreamer-1.0/gdb"
>  CVE_PRODUCT = "gstreamer"
>
>  PTEST_BUILD_HOST_FILES = ""
> +
> +MESON_QEMU_WRAPPER_TEST_ENABLED = "1"
> +
> +GST_MESON_TEST = "${@"gstreamer1.0-meson-qemuwrapper-test.inc" if d.getVar('MESON_QEMU_WRAPPER_TEST_ENABLED') == '1' else ""}"
> +
> +require ${GST_MESON_TEST}
> --
> 2.35.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#161869): https://lists.openembedded.org/g/openembedded-core/message/161869
> Mute This Topic: https://lists.openembedded.org/mt/89221717/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [RFC 1/2] meson.bbclass: add native meson test
  2022-02-17 23:00 [RFC 1/2] meson.bbclass: add native meson test Jose Quaresma
  2022-02-17 23:00 ` [RFC 2/2] gstreamer1.0: add support for running native test Jose Quaresma
@ 2022-02-18  6:58 ` Alexander Kanavin
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2022-02-18  6:58 UTC (permalink / raw)
  To: Jose Quaresma; +Cc: OE-core

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

Alex

On Fri, 18 Feb 2022 at 00:00, Jose Quaresma <quaresma.jose@gmail.com> 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@gmail.com>
> ---
>  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
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#161868): https://lists.openembedded.org/g/openembedded-core/message/161868
> Mute This Topic: https://lists.openembedded.org/mt/89221715/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [RFC 2/2] gstreamer1.0: add support for running native test
  2022-02-18  6:57   ` [OE-core] " Alexander Kanavin
@ 2022-02-20  0:20     ` Jose Quaresma
  0 siblings, 0 replies; 5+ messages in thread
From: Jose Quaresma @ 2022-02-20  0:20 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 11691 bytes --]

Alexander Kanavin <alex.kanavin@gmail.com> escreveu no dia sexta,
18/02/2022 à(s) 06:58:

> I like the idea, but gstreamer build-time testing seems like a bit of
> a work in progress. Is there some other meson-based component where
> this can be showcased and enabled in a more simple way?
>

To enable this feature, the user only to sets a variable:
MESON_QEMU_WRAPPER_TEST_ENABLED = "1"

Or in local configuration:
MESON_QEMU_WRAPPER_TEST_ENABLED:pn-systemd-boot = "1"

Unfortunately the qemu user mode can't run successfully all the tests in
most
of the meson components in OE-Core. I have added the results for the
following recipes:

systemd-boot
    Ok:                 821
    Expected Fail:      0
    Fail:               95
    Unexpected Pass:    0
    Skipped:            33
    Timeout:            0

glib-2.0
    Ok:                 197
    Expected Fail:      0
    Fail:               76
    Unexpected Pass:    0
    Skipped:            0
    Timeout:            2

gstreamer1.0
    Ok:                 95
    Expected Fail:      0
    Fail:               10
    Unexpected Pass:    0
    Skipped:            1
    Timeout:            0

Jose


> Alex
>
> On Fri, 18 Feb 2022 at 00:00, Jose Quaresma <quaresma.jose@gmail.com>
> wrote:
> >
> > This is an exmple of using the native meson test
> >
> > gstreamer1.0-meson-qemuwrapper-test.inc
> > ^ this is receipe part
> >
> > meson-qemuwrapper-helper.sh
> > ^ this is an helper script to skip unsupported tests
> >
> >
> meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
> > ^ this patch helps debugind unsupported tests
> >
> > With EXTRA_OEMESON_TEST = "gst_gstbin" it will only run
> > the gst_gstbin test and the output
> > is the following
> >
> > + meson_do_test
> > + export GST_DEBUG=6
> > + meson test -C
> /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build
> --print-errorlogs gst_gstbin
> >
> > ninja: Entering directory
> `/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build'
> >
> > ninja: no work to do.
> >
> > 1/1 gst_gstbin TIMEOUT        180.12s   killed by signal 15 SIGTERM
> >
> > >>>
> GST_PLUGIN_SCANNER_1_0=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/libs/gst/helpers/gst-plugin-scanner
> GST_PLUGIN_LOADING_WHITELIST=gstreamer GST_STATE_IGNORE_ELEMENTS=''
> MESON_EXE_WRAPPER=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/meson-qemuwrapper
> GST_PLUGIN_PATH_1_0=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build
> MALLOC_PERTURB_=192
> GST_REGISTRY=/build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/tests/check/gst_gstbin.registry
> CK_DEFAULT_TIMEOUT=20 GST_PLUGIN_SYSTEM_PATH_1_0=''
> /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/meson-qemuwrapper
> /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/tests/check/gst_gstbin
> > ――――――――――――――――――――――――――――――――――――― ✀
> ―――――――――――――――――――――――――――――――――――――
> > Listing only the last 100 lines from a long log.
> > 0:00:07.719379569 440069   0x4000025400 DEBUG             GST_STATES
> gstbin.c:2990:gst_bin_change_state_func:<bin0> iterator done
> > 0:00:07.719393717 440069   0x4000061180 LOG              GST_MESSAGE
> gstmessage.c:304:gst_message_new_custom: source fakesink0: creating new
> message 0x400c002100 latency
> > 0:00:07.719413507 440069   0x4000025400 LOG               GST_STATES
> gstelement.c:3282:gst_element_change_state_func:<bin0> default handler
> tries setting state from PLAYING to PAUSED (0023)
> > 0:00:07.719438100 440069   0x4000061180 DEBUG                GST_BUS
> gstbus.c:338:gst_bus_post:<bus0> [msg 0x400c002100] posting on bus latency
> message: 0x400c002100, time 99:99:99.999999999, seq-num 31, element
> 'fakesink0', (NULL)
> > 0:00:07.719441024 440069   0x4000025400 DEBUG             GST_STATES
> gstbin.c:3006:gst_bin_change_state_func:<bin0> we have ASYNC elements
> SUCCESS -> ASYNC
> > 0:00:07.719467032 440069   0x4000025400 DEBUG                    bin
> gstbin.c:2383:gst_bin_sort_iterator_free:<bin0>
> > .
> > .
> > .
> >
> ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
> > Summary of Failures:
> >
> > 1/1 gst_gstbin TIMEOUT        180.12s   killed by signal 15 SIGTERM
> >
> > Ok:                 0
> > Expected Fail:      0
> > Fail:               0
> > Unexpected Pass:    0
> > Skipped:            0
> > Timeout:            1
> >
> > Full log written to
> /build/tmp/work/core2-64-poky-linux/gstreamer1.0/1.20.0-r0/build/meson-logs/testlog.txt
> >
> > + bb_sh_exit_handler
> >
> > Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> > ---
> >  .../gstreamer1.0-meson-qemuwrapper-test.inc   | 15 ++++++
> >  ...show-the-reason-when-spawning-of-gst.patch | 53 +++++++++++++++++++
> >  .../gstreamer1.0/meson-qemuwrapper-helper.sh  | 15 ++++++
> >  .../gstreamer/gstreamer1.0_1.20.0.bb          |  6 +++
> >  4 files changed, 89 insertions(+)
> >  create mode 100644
> meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
> >  create mode 100644
> meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
> >  create mode 100644
> meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh
> >
> > diff --git
> a/meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
> b/meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
> > new file mode 100644
> > index 0000000000..c9f4885f82
> > --- /dev/null
> > +++
> b/meta/recipes-multimedia/gstreamer/gstreamer1.0-meson-qemuwrapper-test.inc
> > @@ -0,0 +1,15 @@
> > +SRC_URI +=
> "file://0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch;striplevel=3"
> > +SRC_URI += "file://meson-qemuwrapper-helper.sh"
> > +
> > +#MESON_QEMU_WRAPPER_HELPER = "${WORKDIR}/meson-qemuwrapper-helper.sh"
> > +
> > +PACKAGECONFIG[tests] = "-Dtests=enabled,-Dtests=disabled"
> > +
> > +# run single test
> > +EXTRA_OEMESON_TEST = "gst_gstbin"
> > +
> > +meson_do_test:prepend() {
> > +    # run the test with the debug mode enabled
> > +    # logs will be placed at build/meson-logs/testlog.txt
> > +    export GST_DEBUG=6
> > +}
> > diff --git
> a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
> b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
> > new file mode 100644
> > index 0000000000..22c8750f5b
> > --- /dev/null
> > +++
> b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstpluginloader-show-the-reason-when-spawning-of-gst.patch
> > @@ -0,0 +1,53 @@
> > +From 8e1de3f84c2e654515b6d6b16783a4a08dfd118d Mon Sep 17 00:00:00 2001
> > +From: Jose Quaresma <quaresma.jose@gmail.com>
> > +Date: Wed, 8 Dec 2021 22:13:15 +0000
> > +Subject: [PATCH] gstpluginloader: show the reason when spawning of
> > + gst-plugin-scanner fail
> > +
> > +This fix helps in cross compiling when the meson tests runs using a
> qemu wraper
> > +
> > +Part-of: <
> https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1701>
> > +
> > +Upstream-Status: Backport [
> https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/8e1de3f84c2e654515b6d6b16783a4a08dfd118d
> ]
> > +
> > +Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> > +---
> > + subprojects/gstreamer/gst/gstpluginloader.c | 14 ++++++++++----
> > + 1 file changed, 10 insertions(+), 4 deletions(-)
> > +
> > +diff --git a/subprojects/gstreamer/gst/gstpluginloader.c
> b/subprojects/gstreamer/gst/gstpluginloader.c
> > +index 10a446fa5e..fb8b45cffa 100644
> > +--- a/subprojects/gstreamer/gst/gstpluginloader.c
> > ++++ b/subprojects/gstreamer/gst/gstpluginloader.c
> > +@@ -413,6 +413,7 @@ gst_plugin_loader_try_helper (GstPluginLoader *
> loader, gchar * location)
> > + {
> > +   char *argv[6] = { NULL, };
> > +   int c = 0;
> > ++  GError *error = NULL;
> > +
> > + #if defined (__APPLE__) && defined (USR_BIN_ARCH_SWITCH)
> > +   if (gst_plugin_loader_use_usr_bin_arch ()) {
> > +@@ -432,11 +433,16 @@ gst_plugin_loader_try_helper (GstPluginLoader *
> loader, gchar * location)
> > +     GST_LOG ("Trying to spawn gst-plugin-scanner helper at %s",
> location);
> > +   }
> > +
> > +-  if (!g_spawn_async_with_pipes (NULL, argv, NULL,
> > +-          G_SPAWN_DO_NOT_REAP_CHILD /* | G_SPAWN_STDERR_TO_DEV_NULL */
> ,
> > +-          NULL, NULL, &loader->child_pid, &loader->fd_w.fd,
> &loader->fd_r.fd,
> > +-          NULL, NULL))
> > ++  g_spawn_async_with_pipes (NULL, argv, NULL,
> > ++      G_SPAWN_DO_NOT_REAP_CHILD /* | G_SPAWN_STDERR_TO_DEV_NULL */ ,
> > ++      NULL, NULL, &loader->child_pid, &loader->fd_w.fd,
> &loader->fd_r.fd,
> > ++      NULL, &error);
> > ++
> > ++  if (error) {
> > ++    GST_ERROR ("Spawning gst-plugin-scanner helper failed: %s",
> error->message);
> > ++    g_clear_error (&error);
> > +     return FALSE;
> > ++  }
> > +
> > +   gst_poll_add_fd (loader->fdset, &loader->fd_w);
> > +   gst_poll_add_fd (loader->fdset, &loader->fd_r);
> > +--
> > +2.35.1
> > +
> > diff --git
> a/meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh
> b/meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh
> > new file mode 100644
> > index 0000000000..7f03f79292
> > --- /dev/null
> > +++
> b/meta/recipes-multimedia/gstreamer/gstreamer1.0/meson-qemuwrapper-helper.sh
> > @@ -0,0 +1,15 @@
> > +#!/bin/sh
> > +#set -x
> > +
> > +test="$(basename "$1")"
> > +
> > +# some tests currently fails so there we skipped the already knowns
> > +skipped="$skipped elements_dataurisrc"
> > +skipped="$skipped libs_gstnettimeprovider"
> > +skipped="$skipped gst_gstelement"
> > +skipped="$skipped gst_gstregistry"
> > +for s in $skipped; do
> > +    if [ "$s" = "$test" ]; then
> > +        exit 77
> > +    fi
> > +done
> > diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
> b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
> > index 243f99fee9..38595b8789 100644
> > --- a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
> > +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.0.bb
> > @@ -70,3 +70,9 @@ FILES:${PN}-dbg += "${datadir}/gdb
> ${datadir}/gstreamer-1.0/gdb"
> >  CVE_PRODUCT = "gstreamer"
> >
> >  PTEST_BUILD_HOST_FILES = ""
> > +
> > +MESON_QEMU_WRAPPER_TEST_ENABLED = "1"
> > +
> > +GST_MESON_TEST = "${@"gstreamer1.0-meson-qemuwrapper-test.inc" if
> d.getVar('MESON_QEMU_WRAPPER_TEST_ENABLED') == '1' else ""}"
> > +
> > +require ${GST_MESON_TEST}
> > --
> > 2.35.1
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#161869):
> https://lists.openembedded.org/g/openembedded-core/message/161869
> > Mute This Topic: https://lists.openembedded.org/mt/89221717/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>


-- 
Best regards,

José Quaresma

[-- Attachment #2: Type: text/html, Size: 15484 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-20  0:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 23:00 [RFC 1/2] meson.bbclass: add native meson test Jose Quaresma
2022-02-17 23:00 ` [RFC 2/2] gstreamer1.0: add support for running native test Jose Quaresma
2022-02-18  6:57   ` [OE-core] " Alexander Kanavin
2022-02-20  0:20     ` Jose Quaresma
2022-02-18  6:58 ` [OE-core] [RFC 1/2] meson.bbclass: add native meson test Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.