diff mbox series

[master] inotify-tools: improve ptest result handling

Message ID 20251027093801.73058-1-nikhil.r@bmwtechworks.in
State Under Review
Headers show
Series [master] inotify-tools: improve ptest result handling | expand

Commit Message

Nikhil R Oct. 27, 2025, 9:38 a.m. UTC
The run-ptest script determines success by grepping for
"0 failed" in the test output. This could incorrectly
report success for cases like "10 failed" or "100 failed".

Update the script to rely on the test binary's exit status instead,
while still capturing and printing full test output for logging.

This makes the ptest behavior more robust and consistent

Signed-off-by: Nikhil R <nikhil.r@bmwtechworks.in>
---
 .../recipes-support/inotify-tools/files/run-ptest  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/inotify-tools/files/run-ptest b/meta-oe/recipes-support/inotify-tools/files/run-ptest
index f3b23d86f0..1bd51248d8 100644
--- a/meta-oe/recipes-support/inotify-tools/files/run-ptest
+++ b/meta-oe/recipes-support/inotify-tools/files/run-ptest
@@ -4,18 +4,18 @@ 
 set -e
 
 # Run the test binary and capture output
-output=$(./test)
+output=$(./test 2>&1)
+status=$?
 
 # 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
+# Evaluate result based on exit code
+if [ $status -eq 0 ]; then
+    echo "All tests passed successfully."
     exit 0
 else
-    echo "Some tests failed!"
+    echo "Test program exited with status $status."
+    echo "Some tests may have failed. See output above for details."
     exit 1
 fi