@@ -65,6 +65,7 @@ PTESTS_FAST = "\
lzo \
m4 \
nettle \
+ npth \
opkg \
popt \
procps \
new file mode 100644
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cd "$(dirname "$0")/tests" || exit 1
+
+for t in t-mutex t-thread t-cond t-fork; do
+ [ -x "./$t" ] || continue
+ if "./$t"; then
+ echo "PASS: $t"
+ else
+ echo "FAIL: $t"
+ fi
+done
@@ -6,14 +6,27 @@ LICENSE = "LGPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2caced0b25dfefd4c601d92bd15116de"
UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
-SRC_URI = "${GNUPG_MIRROR}/npth/npth-${PV}.tar.bz2"
+SRC_URI = "${GNUPG_MIRROR}/npth/npth-${PV}.tar.bz2 \
+ file://run-ptest \
+ "
SRC_URI[sha256sum] = "8bd24b4f23a3065d6e5b26e98aba9ce783ea4fd781069c1b35d149694e90ca3e"
-inherit autotools multilib_header
+inherit autotools multilib_header ptest
do_install:append() {
oe_multilib_header npth.h
}
+do_compile_ptest() {
+ oe_runmake -C ${B}/tests $(makefile-getvar ${B}/tests/Makefile TESTS)
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+ for t in $(makefile-getvar ${B}/tests/Makefile TESTS); do
+ ${B}/libtool --mode=install install -m 0755 ${B}/tests/$t ${D}${PTEST_PATH}/tests/
+ done
+}
+
BBCLASSEXTEND = "native nativesdk"
Add ptest support using npth's upstream test suite, which exercises the core threading wrappers: mutex locking (t-mutex), thread creation and join (t-thread), condition variable signalling (t-cond) and fork handling (t-fork). Signed-off-by: Pratik Farkase <pratik.farkase@est.tech> --- meta/conf/distro/include/ptest-packagelists.inc | 1 + meta/recipes-support/npth/npth/run-ptest | 12 ++++++++++++ meta/recipes-support/npth/npth_1.8.bb | 17 +++++++++++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-support/npth/npth/run-ptest