2016-09-23 13:51:28 +00:00
|
|
|
#!/bin/sh
|
2023-09-05 20:03:15 +00:00
|
|
|
# Look for some frequent error message templates in test logs
|
|
|
|
#
|
|
|
|
# Usage: $0 [test-log.txt]
|
2016-09-23 13:51:28 +00:00
|
|
|
|
2023-09-05 20:19:45 +00:00
|
|
|
ret=0
|
|
|
|
|
2023-09-05 20:03:15 +00:00
|
|
|
scan_log() {
|
|
|
|
local file="$1"
|
2016-09-23 13:51:28 +00:00
|
|
|
|
2023-09-05 20:03:15 +00:00
|
|
|
echo "Scanning $file"
|
2016-09-23 13:51:28 +00:00
|
|
|
last=
|
|
|
|
while read line; do
|
|
|
|
case "$line" in
|
2023-09-05 20:19:45 +00:00
|
|
|
===\ START\ TEST*) last="$line" ;;
|
|
|
|
*Assertion*failed*) ret=1; echo "ASSERTION FAILED: $last" ;;
|
|
|
|
*runtime\ error*) ret=1; echo "RUNTIME ERROR (sanitizer): $last" ;;
|
|
|
|
*AddressSanitizer*heap-use-after-free*) ret=1; echo "RUNTIME ERROR (use after free): $last" ;;
|
|
|
|
*LeakSanitizer:*leak*) ret=1; echo "SANITIZER REPORT: memory leak: $last" ;;
|
|
|
|
*Warning:\ assertion*failed*) ret=1; echo "ASSERTION WARNING: $last" ;;
|
|
|
|
*command\ not\ found*) ret=1; echo "COMMAND NOT FOUND: $last" ;;
|
|
|
|
*extent\ buffer\ leak*) ret=1; echo "EXTENT BUFFER LEAK: $last" ;;
|
2016-09-23 13:51:28 +00:00
|
|
|
*) : ;;
|
|
|
|
esac
|
2023-09-05 20:03:15 +00:00
|
|
|
done < "$file"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Scan only the given file
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
scan_log "$1"
|
2023-09-05 20:19:45 +00:00
|
|
|
exit "$ret"
|
2023-09-05 20:03:15 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Scan all existing test logs
|
|
|
|
for file in *.txt; do
|
|
|
|
scan_log "$file"
|
2016-09-23 13:51:28 +00:00
|
|
|
done
|
2023-09-05 20:19:45 +00:00
|
|
|
|
|
|
|
exit "$ret"
|