Skip to contentSkip to conversation

libxslt: add ptest support

PATCH Superseded Pratik Farkase 2 participants 9 messages May 6 – May 21

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxslt: add ptest support

Add ptest support for libxslt, running the upstream runtest binary which validates XSLT transformations across REC conformance, general, encoding, documents, numbers, keys, namespaces, extensions, reports, and EXSLT function tests.

NOTE: The encoding/bug-146 test is excluded as it requires windows-1251 iconv support not available in minimal images.

Tested on qemux86-64 with ptest-runner: 747 tests, 0 errors.

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/libxslt/libxslt/run-ptest | 17 ++++++++++++
 .../recipes-support/libxslt/libxslt_1.1.45.bb | 26 +++++++++++++++++--
 3 files changed, 42 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libxslt/libxslt/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 1ce8eda46d..566445187d 100644
@@ -60,6 +60,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libxslt \
     libyaml \
     logrotate \
     lua \
meta/recipes-support/libxslt/libxslt/run-ptest new file +17 -0
new file mode 100755
index 0000000000..b82725295c
@@ -0,0 +1,17 @@
+#!/bin/sh
+# SPDX-License-Identifier: MIT
+
+cd "$(dirname "$0")/tests" || exit 1
+
+output=$(./runtest 2>&1)
+ret=$?
+
+echo "$output" | while IFS= read -r line; do
+    echo "$line"
+done
+
+if [ $ret -eq 0 ]; then
+    echo "PASS: runtest"
+else
+    echo "FAIL: runtest"
+fi
meta/recipes-support/libxslt/libxslt_1.1.45.bb +24 -2
index 449ea2dd24..028fa0e5bf 100644
@@ -13,7 +13,9 @@ LIC_FILES_CHKSUM = "file://Copyright;md5=0cd9a07afbeb24026c9b03aecfeba458"
 SECTION = "libs"
 DEPENDS = "libxml2"
 
-SRC_URI = "https://download.gnome.org/sources/libxslt/1.1/libxslt-${PV}.tar.xz"
+SRC_URI = "https://download.gnome.org/sources/libxslt/1.1/libxslt-${PV}.tar.xz \
+           file://run-ptest \
+           "
 
 SRC_URI[sha256sum] = "9acfe68419c4d06a45c550321b3212762d92f41465062ca4ea19e632ee5d216e"
 
@@ -25,7 +27,7 @@ S = "${UNPACKDIR}/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
 
 do_configure:prepend () {
 	# We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header.
@@ -56,3 +58,23 @@ FILES:${PN} += "${libdir}/libxslt-plugins"
 FILES:${PN}-dev += "${libdir}/xsltConf.sh"
 
 BBCLASSEXTEND = "native nativesdk"
+
+do_compile_ptest() {
+    oe_runmake -C ${B}/tests runtest
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    ${B}/libtool --mode=install install -m 0755 ${B}/tests/runtest ${D}${PTEST_PATH}/tests/
+
+    for d in general REC REC2 documents encoding exslt extensions \
+             keys namespaces numbers plugins reports; do
+        if [ -d ${S}/tests/$d ]; then
+            cp -r ${S}/tests/$d ${D}${PTEST_PATH}/tests/
+        fi
+    done
+
+    # Remove encoding test that requires windows-1251 iconv support
+    rm -f ${D}${PTEST_PATH}/tests/encoding/bug-146.*
+}
Signature · 1 line
2.34.1
#1 lore raw

meta/recipes-support/libxslt/libxslt/run-ptest line 11

Quoted 6 lines · Pratik Farkase via lists.openembedded.org
meta/recipes-support/libxslt/libxslt/run-ptest new file +6 -0
+output=$(./runtest 2>&1)
+ret=$?
+
+echo "$output" | while IFS= read -r line; do
+    echo "$line"
+done

Why capture the output just to print it all again?

Ross

#2 lore raw

Hi Ross,

You're right, that's unnecessary. Simplified in v2.

Best Regards,
Pratik

________________________________________
From: Ross Burton <[email protected]>
Sent: Monday, May 18, 2026 2:16 PM
To: Pratik Farkase
Cc: [email protected]; [email protected]
Subject: Re: [OE-core][PATCH v1] libxslt: add ptest support

meta/recipes-support/libxslt/libxslt/run-ptest line 11

Quoted 6 lines · Pratik Farkase via lists.openembedded.org
meta/recipes-support/libxslt/libxslt/run-ptest new file +6 -0
+output=$(./runtest 2>&1)
+ret=$?
+
+echo "$output" | while IFS= read -r line; do
+    echo "$line"
+done

Why capture the output just to print it all again?

Ross

#3 lore raw
Quoted 1 line · Pratik Farkase

You're right, that's unnecessary. Simplified in v2.

I’m curious why you thought to do that in this test case and not the others?

#4 lore raw

I was initially capturing the output thinking I'd need to parse it for per-test PASS/FAIL lines, but runtest already reports everything itself so it wasn't needed. It was just an oversight/inconsistency no any particular reason.

Best Regards,
Pratik

________________________________________
From: Ross Burton <[email protected]>
Sent: Monday, May 18, 2026 2:28 PM
To: Pratik Farkase
Cc: [email protected]; [email protected]
Subject: Re: [OE-core][PATCH v1] libxslt: add ptest support

Quoted 1 line · Pratik Farkase

You're right, that's unnecessary. Simplified in v2.

I’m curious why you thought to do that in this test case and not the others?

#5 lore raw

PATCH v2 1/1 libxslt: add ptest support

In reply to Pratik Farkase

Add ptest support for libxslt, running the upstream runtest binary which validates XSLT transformations across REC conformance, general, encoding, documents, numbers, keys, namespaces, extensions, reports, and EXSLT function tests.

NOTE: The encoding/bug-146 test is excluded as it requires windows-1251 iconv support not available in minimal images.

Tested on qemux86-64 with ptest-runner: 747 tests, 0 errors.

---
Changes in v2:
- Simplify run-ptest: run test binary directly instead of capturing and re-printing output

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/libxslt/libxslt/run-ptest | 11 ++++++++
 .../recipes-support/libxslt/libxslt_1.1.45.bb | 26 +++++++++++++++++--
 3 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libxslt/libxslt/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 68189ec2a3..8b01284b2a 100644
@@ -57,6 +57,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libxslt \
     libyaml \
     logrotate \
     lua \
meta/recipes-support/libxslt/libxslt/run-ptest new file +11 -0
new file mode 100755
index 0000000000..c321fdc606
@@ -0,0 +1,11 @@
+#!/bin/sh
+# SPDX-License-Identifier: MIT
+
+cd "$(dirname "$0")/tests" || exit 1
+
+./runtest 2>&1
+if [ $? -eq 0 ]; then
+    echo "PASS: runtest"
+else
+    echo "FAIL: runtest"
+fi
meta/recipes-support/libxslt/libxslt_1.1.45.bb +24 -2
index 449ea2dd24..028fa0e5bf 100644
@@ -13,7 +13,9 @@ LIC_FILES_CHKSUM = "file://Copyright;md5=0cd9a07afbeb24026c9b03aecfeba458"
 SECTION = "libs"
 DEPENDS = "libxml2"
 
-SRC_URI = "https://download.gnome.org/sources/libxslt/1.1/libxslt-${PV}.tar.xz"
+SRC_URI = "https://download.gnome.org/sources/libxslt/1.1/libxslt-${PV}.tar.xz \
+           file://run-ptest \
+           "
 
 SRC_URI[sha256sum] = "9acfe68419c4d06a45c550321b3212762d92f41465062ca4ea19e632ee5d216e"
 
@@ -25,7 +27,7 @@ S = "${UNPACKDIR}/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
 
 do_configure:prepend () {
 	# We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header.
@@ -56,3 +58,23 @@ FILES:${PN} += "${libdir}/libxslt-plugins"
 FILES:${PN}-dev += "${libdir}/xsltConf.sh"
 
 BBCLASSEXTEND = "native nativesdk"
+
+do_compile_ptest() {
+    oe_runmake -C ${B}/tests runtest
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    ${B}/libtool --mode=install install -m 0755 ${B}/tests/runtest ${D}${PTEST_PATH}/tests/
+
+    for d in general REC REC2 documents encoding exslt extensions \
+             keys namespaces numbers plugins reports; do
+        if [ -d ${S}/tests/$d ]; then
+            cp -r ${S}/tests/$d ${D}${PTEST_PATH}/tests/
+        fi
+    done
+
+    # Remove encoding test that requires windows-1251 iconv support
+    rm -f ${D}${PTEST_PATH}/tests/encoding/bug-146.*
+}
Signature · 1 line
2.43.0
#6 lore raw

meta/recipes-support/libxslt/libxslt_1.1.45.bb FILES:${PN} += "${libdir}/libxslt-plugins" · line 75

Quoted 5 lines · Pratik Farkase via lists.openembedded.org
meta/recipes-support/libxslt/libxslt_1.1.45.bb +5 -0
+    for d in general REC REC2 documents encoding exslt extensions \
+             keys namespaces numbers plugins reports; do
+        if [ -d ${S}/tests/$d ]; then
+            cp -r ${S}/tests/$d ${D}${PTEST_PATH}/tests/
+        fi

Don’t check for existence here, we want to know if this list changes.

meta/recipes-support/libxslt/libxslt_1.1.45.bb FILES:${PN} += "${libdir}/libxslt-plugins" · line 80

Quoted 5 lines
meta/recipes-support/libxslt/libxslt_1.1.45.bb +5 -0
+    done
+
+    # Remove encoding test that requires windows-1251 iconv support
+    rm -f ${D}${PTEST_PATH}/tests/encoding/bug-146.*
+}

I think you can solve this by just rdepending on glibc-charmap-cp1251 (which will need to be conditional on glibc).

Ross

#7 lore raw

Hi Ross,

Thanks again for the review and good suggestion. That makes it even more simpler. What we need here is glibc-gconv-cp1251. I tested this RDEPEND change and all 748 tests pass now including bug-146. Also dropped the existence check as you suggested.

v3 is sent separately fixing these.

Best Regards,
Pratik

________________________________________
From: Ross Burton <[email protected]>
Sent: Wednesday, May 20, 2026 5:57 PM
To: Pratik Farkase
Cc: [email protected]; [email protected]
Subject: Re: [OE-core][PATCH v2] libxslt: add ptest support

meta/recipes-support/libxslt/libxslt_1.1.45.bb FILES:${PN} += "${libdir}/libxslt-plugins" · line 75

Quoted 5 lines · Pratik Farkase via lists.openembedded.org
meta/recipes-support/libxslt/libxslt_1.1.45.bb +5 -0
+    for d in general REC REC2 documents encoding exslt extensions \
+             keys namespaces numbers plugins reports; do
+        if [ -d ${S}/tests/$d ]; then
+            cp -r ${S}/tests/$d ${D}${PTEST_PATH}/tests/
+        fi

Don’t check for existence here, we want to know if this list changes.

meta/recipes-support/libxslt/libxslt_1.1.45.bb FILES:${PN} += "${libdir}/libxslt-plugins" · line 80

Quoted 5 lines
meta/recipes-support/libxslt/libxslt_1.1.45.bb +5 -0
+    done
+
+    # Remove encoding test that requires windows-1251 iconv support
+    rm -f ${D}${PTEST_PATH}/tests/encoding/bug-146.*
+}

I think you can solve this by just rdepending on glibc-charmap-cp1251 (which will need to be conditional on glibc).

Ross

#8 lore raw

PATCH v3 1/1 libxslt: add ptest support

In reply to Pratik Farkase

Add ptest support for libxslt, running the upstream runtest binary which validates XSLT transformations across REC conformance, general, encoding, documents, numbers, keys, namespaces, extensions, reports, and EXSLT function tests.

Tested on qemux86-64 with ptest-runner: 748 tests, 0 errors (9s).

---
Changes in v3:
- Add glibc-gconv-cp1251 RDEPENDS (conditional on glibc) to support encoding/bug-146 test instead of excluding it
- Remove directory existence check to catch upstream changes early

Changes in v2:
- Simplify run-ptest: run test binary directly instead of capturing and re-printing output

 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/libxslt/libxslt/run-ptest | 11 +++++++++
 .../recipes-support/libxslt/libxslt_1.1.45.bb | 23 +++++++++++++++++--
 3 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libxslt/libxslt/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 50b6a8a41e..58ec00e283 100644
@@ -57,6 +57,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libxslt \
     libyaml \
     logrotate \
     lua \
meta/recipes-support/libxslt/libxslt/run-ptest new file +11 -0
new file mode 100755
index 0000000000..c321fdc606
@@ -0,0 +1,11 @@
+#!/bin/sh
+# SPDX-License-Identifier: MIT
+
+cd "$(dirname "$0")/tests" || exit 1
+
+./runtest 2>&1
+if [ $? -eq 0 ]; then
+    echo "PASS: runtest"
+else
+    echo "FAIL: runtest"
+fi
meta/recipes-support/libxslt/libxslt_1.1.45.bb +21 -2
index 449ea2dd24..bdfd8f1737 100644
@@ -13,7 +13,9 @@ LIC_FILES_CHKSUM = "file://Copyright;md5=0cd9a07afbeb24026c9b03aecfeba458"
 SECTION = "libs"
 DEPENDS = "libxml2"
 
-SRC_URI = "https://download.gnome.org/sources/libxslt/1.1/libxslt-${PV}.tar.xz"
+SRC_URI = "https://download.gnome.org/sources/libxslt/1.1/libxslt-${PV}.tar.xz \
+           file://run-ptest \
+           "
 
 SRC_URI[sha256sum] = "9acfe68419c4d06a45c550321b3212762d92f41465062ca4ea19e632ee5d216e"
 
@@ -25,7 +27,7 @@ S = "${UNPACKDIR}/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
 
 do_configure:prepend () {
 	# We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header.
@@ -56,3 +58,20 @@ FILES:${PN} += "${libdir}/libxslt-plugins"
 FILES:${PN}-dev += "${libdir}/xsltConf.sh"
 
 BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-gconv-cp1251"
+
+do_compile_ptest() {
+    oe_runmake -C ${B}/tests runtest
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    ${B}/libtool --mode=install install -m 0755 ${B}/tests/runtest ${D}${PTEST_PATH}/tests/
+
+    for d in general REC REC2 documents encoding exslt extensions \
+             keys namespaces numbers plugins reports; do
+        cp -r ${S}/tests/$d ${D}${PTEST_PATH}/tests/
+    done
+}
Signature · 1 line
2.34.1