Openembedded Core Discussions
 help / color / mirror / Atom feed
* [OE-core][PATCH v1] liburcu: add ptest support
@ 2026-05-05 10:45 Pratik Farkase
  2026-06-08 14:48 ` Ross Burton
  0 siblings, 1 reply; 2+ messages in thread
From: Pratik Farkase @ 2026-05-05 10:45 UTC (permalink / raw)
  To: openembedded-core; +Cc: pratik.farkase, Pratik Farkase

Add ptest support for liburcu, running the upstream unit test suite
(674 TAP assertions across 24 tests). This covers architecture checks,
atomic operations, multiflavor builds, sysfs helpers, and build
verification tests.

Tested on qemux86-64 with ptest-runner: 24 PASS, 0 FAIL.

Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/liburcu/liburcu/run-ptest | 17 +++++++++++
 .../recipes-support/liburcu/liburcu_0.15.6.bb | 30 +++++++++++++++++--
 3 files changed, 46 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/liburcu/liburcu/run-ptest

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 50b6a8a41e..ed89f9dc76 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -48,6 +48,7 @@ PTESTS_FAST = "\
     libtest-warnings-perl \
     libtimedate-perl \
     libtry-tiny-perl \
+    liburcu \
     libusb1 \
     libxml-namespacesupport-perl \
     libxml-parser-perl \
diff --git a/meta/recipes-support/liburcu/liburcu/run-ptest b/meta/recipes-support/liburcu/liburcu/run-ptest
new file mode 100755
index 0000000000..5f8fb4fcfe
--- /dev/null
+++ b/meta/recipes-support/liburcu/liburcu/run-ptest
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+PTEST_PATH=$(dirname "$0")
+cd "$PTEST_PATH/tests/unit" || exit 1
+
+export URCU_TESTS_SRCDIR="$PTEST_PATH/tests"
+export URCU_TESTS_BUILDDIR="$PTEST_PATH/tests"
+export URCU_TESTS_OS_TYPE="linux"
+
+for test in $(find . -maxdepth 1 -type f -executable -name "test_*" | sort); do
+    testname=$(basename "$test")
+    if ./"$test"; then
+        echo "PASS: $testname"
+    else
+        echo "FAIL: $testname"
+    fi
+done
diff --git a/meta/recipes-support/liburcu/liburcu_0.15.6.bb b/meta/recipes-support/liburcu/liburcu_0.15.6.bb
index 1cb349f55d..e02f797041 100644
--- a/meta/recipes-support/liburcu/liburcu_0.15.6.bb
+++ b/meta/recipes-support/liburcu/liburcu_0.15.6.bb
@@ -11,15 +11,41 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=c2a92498b6e88e276f986877995425b8 \
                     file://include/urcu/uatomic/x86.h;beginline=1;endline=6;md5=358d69272ba7b5f85e29e342430d440c \
                     "
 
-SRC_URI = "http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2"
+SRC_URI = "http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \
+           file://run-ptest \
+           "
 
 SRC_URI[sha256sum] = "850b192096eb11ebf2c70e8f97bc7da7479ee41da1bebeb44e3986908bac414f"
 
 S = "${UNPACKDIR}/userspace-rcu-${PV}"
-inherit autotools multilib_header
+inherit autotools multilib_header ptest
 
 CPPFLAGS:append:riscv64  = " -pthread -D_REENTRANT"
 
+RDEPENDS:${PN}-ptest += "bash"
+
 do_install:append() {
     oe_multilib_header urcu/config.h
 }
+
+do_compile_ptest() {
+    oe_runmake -C ${B}/tests/unit check TESTS=
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests/unit
+
+    find ${B}/tests/unit -maxdepth 1 -type f -executable \
+        ! -name "*.la" | while read -r t; do
+        ${B}/libtool --mode=install install -m 0755 "$t" ${D}${PTEST_PATH}/tests/unit/
+    done
+
+    install -m 0755 ${S}/tests/unit/test_get_cpu_mask_from_sysfs ${D}${PTEST_PATH}/tests/unit/
+    install -m 0755 ${S}/tests/unit/test_get_cpu_mask_from_sysfs_cxx ${D}${PTEST_PATH}/tests/unit/
+    install -m 0755 ${S}/tests/unit/test_get_max_cpuid_from_sysfs ${D}${PTEST_PATH}/tests/unit/
+    install -m 0755 ${S}/tests/unit/test_get_max_cpuid_from_sysfs_cxx ${D}${PTEST_PATH}/tests/unit/
+
+    install -d ${D}${PTEST_PATH}/tests/utils
+    install -m 0644 ${S}/tests/utils/tap.sh ${D}${PTEST_PATH}/tests/utils/
+    install -m 0644 ${S}/tests/utils/utils.sh ${D}${PTEST_PATH}/tests/utils/
+}
-- 
2.44.1



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

* Re: [OE-core][PATCH v1] liburcu: add ptest support
  2026-05-05 10:45 [OE-core][PATCH v1] liburcu: add ptest support Pratik Farkase
@ 2026-06-08 14:48 ` Ross Burton
  0 siblings, 0 replies; 2+ messages in thread
From: Ross Burton @ 2026-06-08 14:48 UTC (permalink / raw)
  To: pratik.farkase@est.tech
  Cc: openembedded-core@lists.openembedded.org,
	pratik.farkase@ericsson.com

On 5 May 2026, at 11:45, Pratik Farkase via lists.openembedded.org <pratik.farkase=est.tech@lists.openembedded.org> wrote:
> +    find ${B}/tests/unit -maxdepth 1 -type f -executable \
> +        ! -name "*.la" | while read -r t; do
> +        ${B}/libtool --mode=install install -m 0755 "$t" ${D}${PTEST_PATH}/tests/unit/
> +    done

Feels like makefile-getvar would tidy this up.  

Ross

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

end of thread, other threads:[~2026-06-08 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 10:45 [OE-core][PATCH v1] liburcu: add ptest support Pratik Farkase
2026-06-08 14:48 ` Ross Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox