]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
libatomic-ops: add ptest support
authorPratik Farkase <pratik.farkase@est.tech>
Thu, 21 May 2026 08:15:05 +0000 (10:15 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 4 Jun 2026 10:17:37 +0000 (11:17 +0100)
Add ptest support for libatomic-ops, running the upstream test suite
which validates atomic operations, generalized emulation, pthread-based
fallbacks, lock-free stack, and memory allocation.

Tested on qemux86-64 with ptest-runner: 5 PASS, 0 FAIL.

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/libatomic-ops/libatomic-ops/run-ptest [new file with mode: 0755]
meta/recipes-support/libatomic-ops/libatomic-ops_7.10.0.bb

index 50b6a8a41e0bf50f293cb60fc501cf4e4b8f1da2..5238013c6bb6eaba762e9d7167c3dffa3ea6db33 100644 (file)
@@ -30,6 +30,7 @@ PTESTS_FAST = "\
     json-glib \
     libarchive \
     libassuan \
+    libatomic-ops \
     libcheck \
     libconfig \
     libconvert-asn1-perl \
diff --git a/meta/recipes-support/libatomic-ops/libatomic-ops/run-ptest b/meta/recipes-support/libatomic-ops/libatomic-ops/run-ptest
new file mode 100755 (executable)
index 0000000..355908b
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cd "$(dirname "$0")/tests" || exit 1
+
+for test in $(find . -maxdepth 1 -type f -executable | sort); do
+    testname=$(basename "$test")
+    if ./"$test"; then
+        echo "PASS: $testname"
+    else
+        echo "FAIL: $testname"
+    fi
+done
index c31ccac7b00e4ca27524ac5474430dacfb337f88..82adf417a33347ab9ecf3306b6c6e12487e77ddf 100644 (file)
@@ -8,7 +8,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://LICENSE;md5=5700d28353dfa2f191ca9b1bd707865e \
                     "
 
-SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/libatomic_ops-${PV}.tar.gz"
+SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/libatomic_ops-${PV}.tar.gz \
+           file://run-ptest \
+           "
 GITHUB_BASE_URI = "https://github.com/bdwgc/libatomic_ops/releases"
 
 SRC_URI[sha256sum] = "0db3ebff755db170f65e74a64ec4511812e9ee3185c232eeffeacd274190dfb0"
@@ -19,6 +21,18 @@ S = "${UNPACKDIR}/libatomic_ops-${PV}"
 
 ALLOW_EMPTY:${PN} = "1"
 
-inherit autotools pkgconfig github-releases
+inherit autotools pkgconfig github-releases ptest
+
+do_compile_ptest() {
+    oe_runmake -C ${B}/tests check TESTS=
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    for t in $(makefile-getvar ${B}/tests/Makefile check_PROGRAMS); do
+        ${B}/libtool --mode=install install -m 0755 ${B}/tests/$t ${D}${PTEST_PATH}/tests/
+    done
+}
 
 BBCLASSEXTEND = "native nativesdk"