public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Pratik Farkase <pratik.farkase@est.tech>
To: openembedded-core@lists.openembedded.org
Cc: Pratik Farkase <pratik.farkase@est.tech>
Subject: [PATCH v5] libxslt: add ptest support
Date: Sat, 25 Oct 2025 15:21:07 +0200	[thread overview]
Message-ID: <20251025132107.9296-1-pratik.farkase@est.tech> (raw)
In-Reply-To: <20251023153459.49699-1-pratik.farkase@est.tech>

Add ptest support for libxslt 1.1.43 including:
- do_compile_ptest and do_install_ptest
- test data installation
- cleanup of buildpath references
- added run-ptest installation

Enable --with-plugins only when ptest is enabled, per review feedback.

v3:
- Remove unconditional --with-plugins (leftover from v2)

v4:
- adapt run-ptest to emit PASS: or FAIL: lines for each test
- run-ptest installation with proper permissions

v5:
- Added FILESEXTRAPATHS using ${BPN} for multilib-safe lookup of run-ptest
- Guarded run-ptest install in do_install_ptest() to avoid autobuilder failures.

Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 meta/recipes-support/libxslt/files/run-ptest  | 38 +++++++++++++++
 .../recipes-support/libxslt/libxslt_1.1.43.bb | 46 +++++++++++++++++--
 3 files changed, 82 insertions(+), 3 deletions(-)
 create mode 100755 meta/recipes-support/libxslt/files/run-ptest

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 9950e46776..b295e0049f 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -47,6 +47,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libxslt \
     logrotate \
     lua \
     lzo \
diff --git a/meta/recipes-support/libxslt/files/run-ptest b/meta/recipes-support/libxslt/files/run-ptest
new file mode 100755
index 0000000000..1673f933e5
--- /dev/null
+++ b/meta/recipes-support/libxslt/files/run-ptest
@@ -0,0 +1,38 @@
+#!/bin/sh
+set -eu
+
+PT_DIR="$(dirname "$0")"
+cd "$PT_DIR/tests"
+
+echo "=== Running libxslt ptests ==="
+
+RESULT=0
+
+if [ -x .libs/runtest ]; then
+    echo "Running .libs/runtest"
+    ./.libs/runtest --verbose --timing 2>&1 | tee runtest.log
+    RT_RET=${PIPESTATUS[0]:-0} || RT_RET=$?
+elif [ -x ./runtest ]; then
+    echo "Running runtest"
+    ./runtest --verbose --timing 2>&1 | tee runtest.log
+    RT_RET=${PIPESTATUS[0]:-0} || RT_RET=$?
+else
+    echo "FAIL: runtest binary not found"
+    exit 1
+fi
+
+if [ "$RT_RET" -ne 0 ]; then
+    echo "FAIL: runtest returned $RT_RET"
+    RESULT=1
+else
+    echo "PASS: runtest"
+fi
+
+if [ "$RESULT" -eq 0 ]; then
+    echo "PASS: all libxslt tests passed"
+else
+    echo "FAIL: some libxslt tests failed"
+fi
+
+echo "Finished libxslt ptests"
+exit "$RESULT"
diff --git a/meta/recipes-support/libxslt/libxslt_1.1.43.bb b/meta/recipes-support/libxslt/libxslt_1.1.43.bb
index e08e92085d..e82db99f83 100644
--- a/meta/recipes-support/libxslt/libxslt_1.1.43.bb
+++ b/meta/recipes-support/libxslt/libxslt_1.1.43.bb
@@ -11,10 +11,11 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://Copyright;md5=0cd9a07afbeb24026c9b03aecfeba458"
 
 SECTION = "libs"
-DEPENDS = "libxml2"
+DEPENDS = "libxml2 libxslt-native"
 
 SRC_URI = "https://download.gnome.org/sources/libxslt/1.1/libxslt-${PV}.tar.xz \
-           file://gnome-libxslt-bug-139-apple-fix.diff"
+           file://gnome-libxslt-bug-139-apple-fix.diff \
+	    file://run-ptest"
 
 SRC_URI[sha256sum] = "5a3d6b383ca5afc235b171118e90f5ff6aa27e9fea3303065231a6d403f0183a"
 
@@ -26,7 +27,45 @@ S = "${WORKDIR}/libxslt-${PV}"
 
 BINCONFIG = "${bindir}/xslt-config"
 
-inherit autotools pkgconfig binconfig-disabled lib_package multilib_header
+inherit autotools pkgconfig binconfig-disabled lib_package multilib_header ptest
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
+
+RDEPENDS:${PN}-ptest += "${PN}-bin make libxslt-utils libxml2-utils xmlto coreutils sed grep diffutils bash libxml2-utils perl"
+
+do_compile_ptest() {
+    cp -r ${S}/tests ${B}/
+    oe_runmake -C ${B}/tests runtest || true
+    if grep -q "run-threads" ${B}/tests/Makefile; then
+        oe_runmake -C ${B}/tests run-threads || true
+    fi
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    if [ -d ${B}/tests/.libs ]; then
+        cp -a ${B}/tests/.libs ${D}${PTEST_PATH}/tests/
+    fi
+
+    for f in runtest run-threads; do
+        if [ -f ${B}/tests/$f ]; then
+            install -m 0755 ${B}/tests/$f ${D}${PTEST_PATH}/tests/
+            sed -i -e "s#${TMPDIR}##g" \
+                   -e "s#${B}##g" \
+                   -e "s#${S}##g" \
+                   ${D}${PTEST_PATH}/tests/$f || true
+        fi
+    done
+
+    cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests/ || true
+    find ${D}${PTEST_PATH}/tests -name 'Makefile*' -delete || true
+    find ${D}${PTEST_PATH}/tests -name '.deps' -type d -exec rm -rf {} + || true
+
+    if [ -f ${WORKDIR}/run-ptest ]; then
+        install -m 0755 ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/
+    fi
+}
 
 do_configure:prepend () {
 	# We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header.
@@ -39,6 +78,7 @@ do_configure:prepend () {
 }
 
 EXTRA_OECONF = "--without-python --without-debug --without-crypto"
+EXTRA_OECONF:append:ptest = " --with-plugins"
 # older versions of this recipe had ${PN}-utils
 RPROVIDES:${PN}-bin += "${PN}-utils"
 RCONFLICTS:${PN}-bin += "${PN}-utils"
-- 
2.43.0



  parent reply	other threads:[~2025-10-25 13:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 20:31 [PATCH v2] libxslt: add ptest support Pratik Farkase
2025-10-22 20:41 ` [PATCH v3] " Pratik Farkase
2025-10-23  7:16   ` [OE-core] " Gyorgy Sarvari
2025-10-23  7:46     ` Pratik Farkase
2025-10-23 13:59   ` Mathieu Dubois-Briand
2025-10-23 15:34   ` [PATCH v4] " Pratik Farkase
2025-10-25 10:42     ` [OE-core] " Mathieu Dubois-Briand
2025-10-25 13:24       ` Pratik Farkase
2025-10-25 13:21     ` Pratik Farkase [this message]
2025-10-27  5:56       ` [OE-core] [PATCH v5] " Mathieu Dubois-Briand
2025-10-28 21:05         ` Pratik Farkase
2025-10-29  9:23           ` Gyorgy Sarvari
2025-11-03  9:29             ` Pratik Farkase
2025-10-29 11:49           ` Mathieu Dubois-Briand
2025-11-03  9:41             ` Pratik Farkase
2025-11-04 14:05               ` Pratik Farkase
2025-11-04 14:29                 ` Gyorgy Sarvari
     [not found]                 ` <1874D423590E3BAD.264703@lists.openembedded.org>
2025-11-04 14:43                   ` Gyorgy Sarvari
2025-11-10 16:48                     ` Pratik Farkase
     [not found]                     ` <1876B327C6230E3E.711629@lists.openembedded.org>
2025-11-10 16:51                       ` Pratik Farkase

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251025132107.9296-1-pratik.farkase@est.tech \
    --to=pratik.farkase@est.tech \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox