summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikhil R <nikhil.r@bmwtechworks.in>2025-10-27 15:08:01 +0530
committerKhem Raj <raj.khem@gmail.com>2025-10-28 23:31:29 -0700
commit17012bc181b1aa26dd8e791e8378dd762ad21350 (patch)
tree50d296ab593d04aa06316211ec9425abda1f688a
parenta992e7d222cc177ec651c94964b0ea075bd541bb (diff)
downloadmeta-openembedded-17012bc181b1aa26dd8e791e8378dd762ad21350.tar.gz
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 <nikhil.r@bmwtechworks.in> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-support/inotify-tools/files/run-ptest14
1 files 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 @@
4set -e 4set -e
5 5
6# Run the test binary and capture output 6# Run the test binary and capture output
7output=$(./test) 7output=$(./test 2>&1)
8status=$?
8 9
9# Print the output for logging 10# Print the output for logging
10echo "$output" 11echo "$output"
11 12
12# Extract the summary line 13# Evaluate result based on exit code
13summary=$(echo "$output" | tail -n 1) 14if [ $status -eq 0 ]; then
14 15 echo "All tests passed successfully."
15# Check if any tests failed
16if echo "$summary" | grep -q "0 failed"; then
17 exit 0 16 exit 0
18else 17else
19 echo "Some tests failed!" 18 echo "Test program exited with status $status."
19 echo "Some tests may have failed. See output above for details."
20 exit 1 20 exit 1
21fi 21fi