]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
libxslt: add ptest support
authorPratik Farkase <pratik.farkase@est.tech>
Thu, 21 May 2026 07:49:10 +0000 (09:49 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 4 Jun 2026 10:17:37 +0000 (11:17 +0100)
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).

Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/ptest-packagelists.inc
meta/recipes-support/libxslt/libxslt/run-ptest [new file with mode: 0755]
meta/recipes-support/libxslt/libxslt_1.1.45.bb

index 5238013c6bb6eaba762e9d7167c3dffa3ea6db33..f3f42f908ae0fad57bd43f30342922e317f14241 100644 (file)
@@ -58,6 +58,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libxslt \
     libyaml \
     logrotate \
     lua \
diff --git a/meta/recipes-support/libxslt/libxslt/run-ptest b/meta/recipes-support/libxslt/libxslt/run-ptest
new file mode 100755 (executable)
index 0000000..c321fdc
--- /dev/null
@@ -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
index 449ea2dd2456fb3d9947b21ce2a438acb3f9d010..bdfd8f1737ae1ef585445558f2c3e9a7be9453c2 100644 (file)
@@ -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
+}