]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
libmd: add ptest for 'libmd'
authorNaman Jain <nmjain23@gmail.com>
Fri, 23 Jan 2026 05:44:25 +0000 (11:14 +0530)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 29 Jan 2026 10:08:55 +0000 (10:08 +0000)
Adapt the compile 'test' phony target from Makefile and deploy as
ptest for libmd.
It takes less than 30seconds for ptest completion

Signed-off-by: Naman Jain <namanj1@kpit.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
meta/conf/distro/include/ptest-packagelists.inc
meta/recipes-support/libmd/files/run-ptest [new file with mode: 0644]
meta/recipes-support/libmd/libmd_1.1.0.bb

index 739995bcfe9d692a92c57cdd400922e324132215..b9616e9bf4745f7ad7bf75f8df7ed91f3ba2e0f7 100644 (file)
@@ -32,6 +32,7 @@ PTESTS_FAST = "\
     libconvert-asn1-perl \
     libexif \
     libgpg-error\
+    libmd \
     libnl \
     libpcre \
     librsvg \
diff --git a/meta/recipes-support/libmd/files/run-ptest b/meta/recipes-support/libmd/files/run-ptest
new file mode 100644 (file)
index 0000000..0c4a5f6
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+cd test
+status = 0
+
+for testbin in *; do
+    if [ -x "$testbin" ] && [ ! -d "$testbin" ]; then
+        if "./$testbin"; then
+            echo "PASS: $testbin"
+        else
+            echo "FAIL: $testbin"
+            status=1
+        fi
+    fi
+done
+
+return $status
+
index dc588a0f95ca8e37898fc748e43db11af1cd1700..ffc59deb268c22b4826d197f59891556d4c1c99b 100644 (file)
@@ -8,9 +8,26 @@ HOMEPAGE = "https://www.hadrons.org/software/libmd/"
 LICENSE = "BSD-3-Clause & BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://COPYING;md5=0436d4fb62a71f661d6e8b7812f9e1df"
 
-SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz"
+SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz \
+          file://run-ptest \
+"
 SRC_URI[sha256sum] = "1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332"
 
-inherit autotools
+inherit autotools ptest
+
+do_compile_ptest() {
+    sed -i "/\$(MAKE) \$(AM_MAKEFLAGS) check-TESTS/d" test/Makefile
+    oe_runmake check
+}
+
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/test
+    for bin in ${B}/test/*; do
+        if [ -x "$bin" ]; then
+            ${B}/libtool --mode=install install "$bin" ${D}${PTEST_PATH}/test/$(basename "$bin")
+        fi
+    done
+}
 
 BBCLASSEXTEND = "native nativesdk"