aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2023-07-27 15:40:31 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2023-07-27 15:42:54 +0000
commit77d34412b8305df9f5431bc6eb2c1cebfabdc9a7 (patch)
tree30ed731ace54ed08526386fed77deb37d97cf6e2
parent719a83b0ee2246cb57aee1c1fe0f25645878c150 (diff)
lib/make.sh (create_glibc_tests_log): New function
... to create tests.log from output of failed glibc tests. Change-Id: Idabcd45cfb1715d9933e76a71a4fbe678531553f
-rw-r--r--lib/make.sh37
1 files changed, 33 insertions, 4 deletions
diff --git a/lib/make.sh b/lib/make.sh
index 85c9eb73..58986433 100644
--- a/lib/make.sh
+++ b/lib/make.sh
@@ -941,6 +941,38 @@ tool_to_check()
echo "$check"
}
+# Create tests.log from output of failed glibc tests.
+create_glibc_tests_log ()
+{
+ (
+ set -euf -o pipefail
+ local builddir="$1"
+
+ if ! [ -f "$builddir/tests.sum" ]; then
+ return 0
+ fi
+
+ local test_log="$builddir/tests.log"
+ echo "=== glibc failures ===" > "$test_log"
+
+ local test_result
+ while IFS= read -r -d '' test_result; do
+ if grep "^(PASS|XFAIL):" "$test_result"; then
+ continue
+ fi
+
+ echo >> "$test_log"
+ cat "$test_result" >> "$test_log"
+
+ # Add output of failed test
+ test_result="${test_result%.test-result}.out"
+ if [ -f "$test_result" ]; then
+ cat "$test_result" >> "$test_log"
+ fi
+ done < <(find "$builddir" -name "*.test-result" -print0)
+ )
+}
+
# $1 - The component to test
# $2 - If set to anything, installed tools are used'
make_check()
@@ -1317,10 +1349,7 @@ EOF
glibc)
find "${builddir}$dir" -name subdir-tests.sum \
-delete
- # Rename glibc's sum file and create a dummy .log
- if [ -f "${builddir}$dir/tests.sum" ]; then
- touch "${builddir}$dir/tests.log"
- fi
+ create_glibc_tests_log "${builddir}$dir"
;;
gdb)
find "${builddir}$dir" \