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 <[email protected]> --- .../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 diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc index 920e63e4b4..1ce8eda46d 100644 --- a/meta/conf/distro/include/ptest-packagelists.inc +++ b/meta/conf/distro/include/ptest-packagelists.inc @@ -31,6 +31,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 index 0000000000..355908b85d --- /dev/null +++ b/meta/recipes-support/libatomic-ops/libatomic-ops/run-ptest @@ -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 diff --git a/meta/recipes-support/libatomic-ops/libatomic-ops_7.10.0.bb b/meta/recipes-support/libatomic-ops/libatomic-ops_7.10.0.bb index c31ccac7b0..9971124213 100644 --- a/meta/recipes-support/libatomic-ops/libatomic-ops_7.10.0.bb +++ b/meta/recipes-support/libatomic-ops/libatomic-ops_7.10.0.bb @@ -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" -- 2.34.1
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#236532): https://lists.openembedded.org/g/openembedded-core/message/236532 Mute This Topic: https://lists.openembedded.org/mt/119175663/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
