All of lore.kernel.org
 help / color / mirror / Atom feed
From: Virendra Thakur <thakur.virendra1810@gmail.com>
To: openembedded-devel@lists.openembedded.org
Cc: Nikhil R <nikhil.r@bmwtechworks.in>
Subject: [meta-oe][scarthgap][PATCH] inotify-tools: add ptest support for inotify-tools
Date: Thu, 23 Oct 2025 16:22:31 +0530	[thread overview]
Message-ID: <20251023105231.688693-1-virendra.thakur@kpit.com> (raw)

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: Virendra Thakur <virendra.thakur@kpit.com>
---
 .../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

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..f3b23d86f0
--- /dev/null
+++ b/meta-oe/recipes-support/inotify-tools/inotify-tools/run-ptest
@@ -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
diff --git 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
index 8a0ae17ad7..3629ce45b2 100644
--- 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
@@ -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}"
-- 
2.34.1



             reply	other threads:[~2025-10-23 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23 10:52 Virendra Thakur [this message]
2025-10-23 15:30 ` [oe] [meta-oe][scarthgap][PATCH] inotify-tools: add ptest support for inotify-tools Khem Raj
2025-10-30  6:01   ` Mittal, Anuj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251023105231.688693-1-virendra.thakur@kpit.com \
    --to=thakur.virendra1810@gmail.com \
    --cc=nikhil.r@bmwtechworks.in \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.