diff mbox series

icu: use automake ptest output format

Message ID 20251024072750.2756709-1-jiaying.song.cn@windriver.com
State New
Headers show
Series icu: use automake ptest output format | expand

Commit Message

Song, Jiaying (CN) Oct. 24, 2025, 7:27 a.m. UTC
From: Jiaying Song <jiaying.song.cn@windriver.com>

Make ICU ptest output compatible with the Automake format, and log the
ICU test output to a date-stamped file with a test summary appended.

Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
---
 meta/recipes-support/icu/icu/run-ptest | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-support/icu/icu/run-ptest b/meta/recipes-support/icu/icu/run-ptest
index e5bf27a822..0c845f2be7 100755
--- a/meta/recipes-support/icu/icu/run-ptest
+++ b/meta/recipes-support/icu/icu/run-ptest
@@ -2,12 +2,20 @@ 
 
 TOPDIR=$(dirname "$(realpath $0)")
 cd ${TOPDIR}/test/tests
+LOG="${TOPDIR}/ptest_$(date +%Y%m%d-%H%M%S).log"
 TESTS=$(find . -executable -type f)
 for t in ${TESTS}; do
-	./$t
-	if [ "$?" = "0" ]; then
-		echo "PASS: $t"
-	else
-		echo "FAIL: $t"
-	fi
+    ./"$t" 2>&1 | sed -e '/---\[OK\]/ s/^/PASS: /' \
+                      -e '/} OK:/ s/^/PASS: /' \
+                      -e '/---\[[0-9]* ERRORS in / s/^/FAIL: /' \
+                      -e '/} ERRORS/ s/^/FAIL: /' | tee -a "${LOG}"
 done
+
+passed=$(grep '^PASS:' "${LOG}" | wc -l)
+failed=$(grep '^FAIL:' "${LOG}" | wc -l)
+total=$((passed + failed))
+
+echo "=== Test Summary ===" | tee -a "${LOG}"
+echo "TOTAL: ${total}" | tee -a "${LOG}"
+echo "PASSED: ${passed}" | tee -a "${LOG}"
+echo "FAILED: ${failed}" | tee -a "${LOG}"