new file mode 100644
@@ -0,0 +1,21 @@
+#!/bin/sh
+# run-ptest for inotify-tools
+
+set -e
+
+# Run the test binary and capture output
+output=$(./test)
+
+# Print the output for logging
+echo "$output"
+
+# Extract the summary line
+summary=$(echo "$output" | tail -n 1)
+
+# Check if any tests failed
+if echo "$summary" | grep -q "0 failed"; then
+ exit 0
+else
+ echo "Some tests failed!"
+ exit 1
+fi
@@ -10,11 +10,12 @@ SRC_URI = "git://github.com/${BPN}/${BPN};branch=master;protocol=https \
file://0002-libinotifytools-Bridge-differences-between-musl-glib.patch \
file://0002-configure-Add-AC_SYS_LARGEFILE-autoconf-macro.patch \
file://0003-replace-stat64-lstat64-with-stat-lstat.patch \
+ file://run-ptest \
"
S = "${WORKDIR}/git"
-inherit autotools
+inherit autotools ptest
EXTRA_OECONF = "--disable-doxygen"
@@ -25,3 +26,16 @@ CFLAGS += "-Wno-error"
PACKAGES =+ "libinotifytools"
FILES:libinotifytools = "${libdir}/lib*.so.*"
+
+do_compile_ptest() {
+ cd libinotifytools/src
+ oe_runmake
+ oe_runmake test
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}
+ cp -r ${B}/libinotifytools/src/.libs/test ${D}${PTEST_PATH}/
+}
+
+FILES:${PN}-ptest += "${PTEST_PATH}"