summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikhil R <nikhil.r@bmwtechworks.in>2025-11-05 10:25:40 +0530
committerGyorgy Sarvari <skandigraun@gmail.com>2025-11-05 16:46:21 +0100
commitc3c873d0dcc1a07d056b4fb498ca8424e70da884 (patch)
tree48f22704307b119fb13f5c1da2b3428d882d5db8
parent03cca3a1470ba0e629598c55da539a231a33a04a (diff)
downloadmeta-openembedded-c3c873d0dcc1a07d056b4fb498ca8424e70da884.tar.gz
inotify-tools: add ptest support for inotify-tools
Add ptest support for inotify-tools by introducing a run-ptest script. The ptest verifies the correct functioning of inotify event handling and related utilities. Test coverage includes: - File creation, modification, and deletion event monitoring - Event handling and command-line option parsing - Basic consistency and behavior of inotify event queues The ptest completes in under 20 seconds output: root@qemux86-64:~# ptest-runner inotify-tools START: ptest-runner BEGIN: /usr/lib/inotify-tools/ptest If you want to do a malloc trace, set MALLOC_TRACE to a path for logging. event_to_str: test begin event_to_str: test end event_to_str_sep: test begin event_to_str_sep: test end str_to_event: test begin str_to_event: test end str_to_event_sep: test begin str_to_event_sep: test end basic_watch_info: test begin basic_watch_info: test end watch_limit: test begin watch_limit: Warning, this test may take a while watch_limit: test end tst_inotifytools_snprintf: test begin tst_inotifytools_snprintf: test end Out of 362746 tests, 362746 succeeded and 0 failed. All tests passed successfully. DURATION: 16 END: /usr/lib/inotify-tools/ptest STOP: ptest-runner TOTAL: 1 FAIL: 0 Verified that enabling ptest does not modify existing package contents for inotify-tools Signed-off-by: Nikhil R <nikhil.r@bmwtechworks.in> Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
-rw-r--r--meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest15
-rw-r--r--meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.1.0.bb16
2 files changed, 30 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest b/meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest
new file mode 100644
index 0000000000..c45b75e387
--- /dev/null
+++ b/meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest
@@ -0,0 +1,15 @@
1#!/bin/sh
2# run-ptest for inotify-tools
3
4# Run the test binary and show output
5./test
6status=$?
7
8# Exit with the test’s result code
9if [ $status -eq 0 ]; then
10 echo "All tests passed successfully."
11else
12 echo "Some tests failed. See output above for details."
13fi
14
15exit $status
diff --git a/meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.1.0.bb b/meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.1.0.bb
index 4e6bfbbc27..e8ed69d449 100644
--- a/meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.1.0.bb
+++ b/meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.1.0.bb
@@ -9,11 +9,12 @@ SRCREV = "4b72dcd15299e1d0cb096397d9aab513ffed1657"
9 9
10SRC_URI = "git://github.com/${BPN}/${BPN};branch=master;protocol=https \ 10SRC_URI = "git://github.com/${BPN}/${BPN};branch=master;protocol=https \
11 file://0002-libinotifytools-Bridge-differences-between-musl-glib.patch \ 11 file://0002-libinotifytools-Bridge-differences-between-musl-glib.patch \
12 file://run-ptest \
12 " 13 "
13 14
14S = "${WORKDIR}/git" 15S = "${WORKDIR}/git"
15 16
16inherit autotools 17inherit autotools ptest
17 18
18EXTRA_OECONF = "--disable-doxygen" 19EXTRA_OECONF = "--disable-doxygen"
19 20
@@ -24,3 +25,16 @@ CFLAGS += "-Wno-error"
24PACKAGES =+ "libinotifytools" 25PACKAGES =+ "libinotifytools"
25 26
26FILES:libinotifytools = "${libdir}/lib*.so.*" 27FILES:libinotifytools = "${libdir}/lib*.so.*"
28
29do_compile_ptest() {
30 cd libinotifytools/src
31 oe_runmake
32 oe_runmake test
33}
34
35do_install_ptest() {
36 install -d ${D}${PTEST_PATH}
37 cp -r ${B}/libinotifytools/src/.libs/test ${D}${PTEST_PATH}/
38}
39
40FILES:${PN}-ptest += "${PTEST_PATH}"