diff options
| author | Nikhil R <nikhil.r@bmwtechworks.in> | 2025-10-24 15:46:46 +0530 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-10-24 09:06:24 -0700 |
| commit | 66ed465cc19a00f7fe8d95ef68c24d8ced71f040 (patch) | |
| tree | 75074d5003fa1c48308db88cacd8d47bc2b55a8a | |
| parent | f8c9aa83e70ee9084b44dd58cf994d1849714b2d (diff) | |
| download | meta-openembedded-66ed465cc19a00f7fe8d95ef68c24d8ced71f040.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
Signed-off-by: Nikhil R <nikhil.r@bmwtechworks.in>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-support/inotify-tools/files/run-ptest | 21 | ||||
| -rw-r--r-- | meta-oe/recipes-support/inotify-tools/inotify-tools_4.25.9.0.bb | 16 |
2 files changed, 36 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/inotify-tools/files/run-ptest b/meta-oe/recipes-support/inotify-tools/files/run-ptest new file mode 100644 index 0000000000..f3b23d86f0 --- /dev/null +++ b/meta-oe/recipes-support/inotify-tools/files/run-ptest | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # run-ptest for inotify-tools | ||
| 3 | |||
| 4 | set -e | ||
| 5 | |||
| 6 | # Run the test binary and capture output | ||
| 7 | output=$(./test) | ||
| 8 | |||
| 9 | # Print the output for logging | ||
| 10 | echo "$output" | ||
| 11 | |||
| 12 | # Extract the summary line | ||
| 13 | summary=$(echo "$output" | tail -n 1) | ||
| 14 | |||
| 15 | # Check if any tests failed | ||
| 16 | if echo "$summary" | grep -q "0 failed"; then | ||
| 17 | exit 0 | ||
| 18 | else | ||
| 19 | echo "Some tests failed!" | ||
| 20 | exit 1 | ||
| 21 | fi | ||
diff --git a/meta-oe/recipes-support/inotify-tools/inotify-tools_4.25.9.0.bb b/meta-oe/recipes-support/inotify-tools/inotify-tools_4.25.9.0.bb index a107925ce1..a03b835641 100644 --- a/meta-oe/recipes-support/inotify-tools/inotify-tools_4.25.9.0.bb +++ b/meta-oe/recipes-support/inotify-tools/inotify-tools_4.25.9.0.bb | |||
| @@ -7,10 +7,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ac6c26e52aea428ee7f56dc2c56424c6" | |||
| 7 | SRCREV = "81c6c9881edf4844f2b8250e63f82da9cb7f5444" | 7 | SRCREV = "81c6c9881edf4844f2b8250e63f82da9cb7f5444" |
| 8 | 8 | ||
| 9 | SRC_URI = "git://github.com/${BPN}/${BPN};branch=master;protocol=https \ | 9 | SRC_URI = "git://github.com/${BPN}/${BPN};branch=master;protocol=https \ |
| 10 | file://run-ptest \ | ||
| 10 | " | 11 | " |
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | inherit autotools | 14 | inherit autotools ptest |
| 14 | 15 | ||
| 15 | EXTRA_OECONF = "--disable-doxygen" | 16 | EXTRA_OECONF = "--disable-doxygen" |
| 16 | 17 | ||
| @@ -21,3 +22,16 @@ CFLAGS += "-Wno-error" | |||
| 21 | PACKAGES =+ "libinotifytools" | 22 | PACKAGES =+ "libinotifytools" |
| 22 | 23 | ||
| 23 | FILES:libinotifytools = "${libdir}/lib*.so.*" | 24 | FILES:libinotifytools = "${libdir}/lib*.so.*" |
| 25 | |||
| 26 | do_compile_ptest() { | ||
| 27 | cd libinotifytools/src | ||
| 28 | oe_runmake | ||
| 29 | oe_runmake test | ||
| 30 | } | ||
| 31 | |||
| 32 | do_install_ptest() { | ||
| 33 | install -d ${D}${PTEST_PATH} | ||
| 34 | cp -r ${B}/libinotifytools/src/.libs/test ${D}${PTEST_PATH}/ | ||
| 35 | } | ||
| 36 | |||
| 37 | FILES:${PN}-ptest += "${PTEST_PATH}" | ||
