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>
json-glib \
libarchive \
libassuan \
+ libatomic-ops \
libcheck \
libconfig \
libconvert-asn1-perl \
--- /dev/null
+#!/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
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"
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"