diff mbox series

[meta-multimedia,kirkstone,3/4] gupnp-av: add ptest support

Message ID 20251206183154.3656603-3-skandigraun@gmail.com
State New
Headers show
Series [meta-multimedia,kirkstone,1/4] gssdp: add ptest support | expand

Commit Message

Gyorgy Sarvari Dec. 6, 2025, 6:31 p.m. UTC
It takes around a second to execute the suite.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 65c2f6de55fa662bce0281046ed3f291c414ff82)

Adapted to Kirkstone.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 .../gupnp/gupnp-av/run-ptest                  | 12 +++++++++++
 .../gupnp/gupnp-av_0.14.0.bb                  | 21 +++++++++++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)
 create mode 100644 meta-multimedia/recipes-connectivity/gupnp/gupnp-av/run-ptest
diff mbox series

Patch

diff --git a/meta-multimedia/recipes-connectivity/gupnp/gupnp-av/run-ptest b/meta-multimedia/recipes-connectivity/gupnp/gupnp-av/run-ptest
new file mode 100644
index 0000000000..0f7504cd3b
--- /dev/null
+++ b/meta-multimedia/recipes-connectivity/gupnp/gupnp-av/run-ptest
@@ -0,0 +1,12 @@ 
+#!/bin/sh
+RET=0
+cd tests
+for t in $(find . -type f -executable); do
+    if ./$t; then
+        echo PASS: $t
+    else
+        echo FAIL: $t
+        RET=1
+    fi
+done
+exit $RET
diff --git a/meta-multimedia/recipes-connectivity/gupnp/gupnp-av_0.14.0.bb b/meta-multimedia/recipes-connectivity/gupnp/gupnp-av_0.14.0.bb
index b253c54d92..e4ffa06355 100644
--- a/meta-multimedia/recipes-connectivity/gupnp/gupnp-av_0.14.0.bb
+++ b/meta-multimedia/recipes-connectivity/gupnp/gupnp-av_0.14.0.bb
@@ -6,7 +6,24 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 
 DEPENDS = "gupnp"
 
-inherit meson pkgconfig gobject-introspection vala
+inherit meson pkgconfig gobject-introspection vala ptest
 
-SRC_URI = "${GNOME_MIRROR}/${BPN}/0.14/${BPN}-${PV}.tar.xz"
+SRC_URI = "${GNOME_MIRROR}/${BPN}/0.14/${BPN}-${PV}.tar.xz \
+           file://run-ptest"
 SRC_URI[sha256sum] = "20aed546fc882e78a3f186a0c8bce5c841cc3a44b7ea528298fbdc82596fb156"
+
+do_configure:prepend(){
+    # set ABS_TOP_SRCDIR to ${PTEST_PATH instead of the source-dir on the host}
+    sed -i "s!\(-DABS_TOP_SRCDIR=\"\).*!\1${PTEST_PATH}/tests\"'],!" ${S}/tests/meson.build
+    # same for DATA_PATH in the other test folder
+    sed -i "s!\(-DDATA_PATH=\"\).*!\1${PTEST_PATH}/tests\"']!" ${S}/tests/gtest/meson.build
+}
+
+do_install_ptest(){
+    cd ${B}/tests
+    find . -type f -executable -exec install -D {} ${D}${PTEST_PATH}/tests/{} \;
+    cp -r ${S}/tests/gtest/data ${D}${PTEST_PATH}/tests
+
+    # this test is not enabled for execution in 0.14.4 in meson.build
+    rm ${D}${PTEST_PATH}/tests/test-search-criteria-parser
+}