inotify-tools: add ptest support for inotify-tools
PATCH 1/1 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
--- .../inotify-tools/inotify-tools/run-ptest | 21 +++++++++++++++++++ .../inotify-tools/inotify-tools_3.22.6.0.bb | 16 +++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest
meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest new file +21 -0
@@ -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
meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.6.0.bb +15 -1
@@ -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}"
Signature · 1 line
2.34.1
This should be in master as well and then back ported to release branches please submit it against master first after making sure it works there
Quoted 104 lines · virendra thakur via lists.openembedded.org
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 queuesThe ptest completes in under 20 seconds
Signed-off-by Nikhil R <[email protected]>Signed-off-by Virendra Thakur <[email protected]>--- .../inotify-tools/inotify-tools/run-ptest | 21 +++++++++++++++++++ .../inotify-tools/inotify-tools_3.22.6.0.bb | 16 +++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest
meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest new file +21
-0@@ -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(quoted diff) +0
-0inotify-tools_3.22.6.0.bb b/meta-oe/recipes-support/inotify-tools/ inotify-tools_3.22.6.0.bb
index8a0ae17ad7..3629ce45b2100644meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.6.0.bb +0
-0@@ -10,11 +10,12 @@ SRC_URI = "git://github.com/${BPN}/${BPN};branch=master;protocol=https
<http://github.com/$%7BBPN%7D/$%7BBPN%7D;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 \meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.6.0.bb +15
-2+ 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}" --2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#120932):
https://lists.openembedded.org/g/openembedded-devel/message/120932
Mute This Topic: https://lists.openembedded.org/mt/115908396/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Yes, please also include the sample output, how many tests run/pass/fail.
If this is really required for scarthgap, then please ensure that this does not result in change in packaging for existing packages. It doesn't look like the case here but please verify.
Quoted 116 lines · Khem Raj via lists.openembedded.org
This should be in master as well and then back ported to release branches please submit it against master first after making sure it works there
Quoted 109 lines · virendra thakur via lists.openembedded.org
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 queuesThe ptest completes in under 20 seconds
Signed-off-by Nikhil R <[email protected]>Signed-off-by Virendra Thakur <[email protected]>---
.../inotify-tools/inotify-tools/run-ptest | 21
+++++++++++++++++++
.../inotify-tools/inotify-tools_3.22.6.0.bb | 16 +++++++++++++-2 files changed, 36 insertions(+), 1 deletion(-)create mode 100644 meta-oe/recipes-support/inotify-tools/inotify-
tools/run-ptest(quoted diff) +0
-0
tools/run-ptestb/meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest
new file mode 100644
index 0000000000..f3b23d86f0meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest new file +21
-0@@ -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(quoted diff) +0
-0tools_3.22.6.0.bb b/meta-oe/recipes-support/inotify-tools/inotify- tools_3.22.6.0.bb
index8a0ae17ad7..3629ce45b2100644
--- a/meta-oe/recipes-support/inotify-tools/inotify- tools_3.22.6.0.bb
+++ b/meta-oe/recipes-support/inotify-tools/inotify- tools_3.22.6.0.bb(quoted diff) +0
-0@@ -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"
meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.6.0.bb +1
-1-inherit autotools +inherit autotools ptestEXTRA_OECONF = "--disable-doxygen"
(quoted diff) +0
-0@@ -25,3 +26,16 @@ CFLAGS += "-Wno-error"PACKAGES =+ "libinotifytools"
FILES:libinotifytools = "${libdir}/lib*.so.*"
meta-oe/recipes-support/inotify-tools/inotify-tools_3.22.6.0.bb +13
-1+ +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}" -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group. View/Reply Online (#120937):
https://lists.openembedded.org/g/openembedded-devel/message/120937
Mute This Topic:
https://lists.openembedded.org/mt/115908396/3616702
Group Owner: [email protected] Unsubscribe:
https://lists.openembedded.org/g/openembedded-devel/unsub [
[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-