From 17012bc181b1aa26dd8e791e8378dd762ad21350 Mon Sep 17 00:00:00 2001 From: Nikhil R Date: Mon, 27 Oct 2025 15:08:01 +0530 Subject: [PATCH] inotify-tools: improve ptest result handling 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 Signed-off-by: Khem Raj --- .../recipes-support/inotify-tools/files/run-ptest | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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