From 7af0bdb0fec638be67d8fe4e655f026e0d08a312 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 18 Aug 2026 03:55:33 +0200 Subject: [PATCH] hunspell: keep ptest failure diagnostics instead of discarding them run-ptest ran each case as "./test.sh $test > /dev/null 2>&1", throwing away the only thing that explains a failure: test.sh prints which check failed and which words were misrecognised, e.g. Fail in base.good. Good words recognised as wrong: Without it a failing hunspell ptest reports a bare "FAIL: " and gives no way to tell a packaging problem from a real defect when the suite runs on target. Capture the output and print it, indented, under the FAIL line, and take test.sh's exit status directly rather than reading $? inside the else branch of the if that consumed it. Signed-off-by: Khem Raj --- .../recipes-support/hunspell/files/run-ptest | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/meta-oe/recipes-support/hunspell/files/run-ptest b/meta-oe/recipes-support/hunspell/files/run-ptest index d2671c9d4e..bccf23506f 100644 --- a/meta-oe/recipes-support/hunspell/files/run-ptest +++ b/meta-oe/recipes-support/hunspell/files/run-ptest @@ -16,15 +16,20 @@ for test in $tests; do if echo "$SKIP_TESTS" | grep -qw "$test"; then continue fi - - if ./test.sh "$test" > /dev/null 2>&1; then + + # Capture test.sh output rather than discarding it: on failure it + # reports which check failed and which words were misrecognised, + # which is the only usable diagnostic when running on target. + output=$(./test.sh "$test" 2>&1) + status=$? + + if [ $status -eq 0 ]; then echo "PASS: $test" + elif [ $status -eq 3 ]; then + echo "SKIP: $test" else - status=$? - if [ $status -eq 3 ]; then - echo "SKIP: $test" - else - echo "FAIL: $test" - fi + echo "FAIL: $test" + # Indent so ptest-runner does not mistake diagnostics for results. + printf '%s\n' "$output" | sed 's/^/ /' fi done