]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
libassuan: add ptest support
authorPratik Farkase <pratik.farkase@est.tech>
Tue, 10 Feb 2026 19:50:41 +0000 (20:50 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Feb 2026 17:27:28 +0000 (17:27 +0000)
Add ptest support to enable automated testing of libassuan
using ptest-runner.

The implementation installs test programs (version, pipeconnect,
fdpassing) and the shell script test (fdpassing-socket.sh).

All 4 tests pass on qemux86-64:
START: ptest-runner
BEGIN: /usr/lib/libassuan/ptest
PASS: version
Received data `Your lucky number is 3552664958674928.  Watch for it everywhere.'
PASS: pipeconnect
PASS: fdpassing
PASS: fdpassing-socket.sh
END: /usr/lib/libassuan/ptest
STOP: ptest-runner
TOTAL: 1 FAIL: 0

Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/ptest-packagelists.inc
meta/recipes-support/libassuan/libassuan/run-ptest [new file with mode: 0755]
meta/recipes-support/libassuan/libassuan_3.0.2.bb

index 932575067f615650450212db4bf47d6cd87ee7d3..e00b9be3265f6cda7ed8416f3177912512f8773f 100644 (file)
@@ -29,6 +29,7 @@ PTESTS_FAST = "\
     json-c \
     json-glib \
     libarchive \
+    libassuan \
     libcheck \
     libconvert-asn1-perl \
     libexif \
diff --git a/meta/recipes-support/libassuan/libassuan/run-ptest b/meta/recipes-support/libassuan/libassuan/run-ptest
new file mode 100755 (executable)
index 0000000..cbf971e
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cd tests
+
+for t in version pipeconnect fdpassing fdpassing-socket.sh; do
+    ./$t
+    if [ $? -eq 0 ]; then
+        echo "PASS: $t"
+    else
+        echo "FAIL: $t"
+    fi
+done
index 0d2ccce989691be38670543244f84f52a0ffa905..2ae2fa77cb4af4137cbf94b39ccaea30dead4439 100644 (file)
@@ -18,13 +18,14 @@ DEPENDS = "libgpg-error"
 UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
 SRC_URI = "${GNUPG_MIRROR}/libassuan/libassuan-${PV}.tar.bz2 \
            file://libassuan-add-pkgconfig-support.patch \
+           file://run-ptest \
           "
 
 SRC_URI[sha256sum] = "d2931cdad266e633510f9970e1a2f346055e351bb19f9b78912475b8074c36f6"
 
 BINCONFIG = "${bindir}/libassuan-config"
 
-inherit autotools texinfo binconfig-disabled pkgconfig multilib_header
+inherit autotools texinfo binconfig-disabled pkgconfig multilib_header ptest
 
 require recipes-support/gnupg/drop-unknown-suffix.inc
 
@@ -37,4 +38,19 @@ do_install:append () {
     oe_multilib_header assuan.h
 }
 
+do_compile_ptest() {
+    oe_runmake -C tests check TESTS=
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    for test in version pipeconnect fdpassing; do
+            ${B}/libtool --mode=install install -m 0755 ${B}/tests/$test ${D}${PTEST_PATH}/tests/
+    done
+
+    install -m 0755 ${S}/tests/fdpassing-socket.sh ${D}${PTEST_PATH}/tests/
+    install -m 0644 ${S}/tests/motd ${D}${PTEST_PATH}/tests/
+}
+
 BBCLASSEXTEND = "native nativesdk"