@@ -31,6 +31,7 @@ PTESTS_FAST = "\
json-glib \
libarchive \
libassuan \
+ libatomic-ops \
libcheck \
libconfig \
libconvert-asn1-perl \
new file mode 100755
@@ -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
@@ -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,19 @@ 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
+
+ find ${B}/tests -maxdepth 1 -type f -executable \
+ ! -name "*.la" | while read -r t; do
+ ${B}/libtool --mode=install install -m 0755 "$t" ${D}${PTEST_PATH}/tests/
+ done
+}
BBCLASSEXTEND = "native nativesdk"
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> --- .../distro/include/ptest-packagelists.inc | 1 + .../libatomic-ops/libatomic-ops/run-ptest | 12 ++++++++++++ .../libatomic-ops/libatomic-ops_7.10.0.bb | 19 +++++++++++++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100755 meta/recipes-support/libatomic-ops/libatomic-ops/run-ptest