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: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 19:53:23 +00:00
|
|
|
===\ START\ TEST*) last="$line" ;;
|
2016-09-23 13:51:28 +00:00
|
|
|
*Assertion*failed*) echo "ASSERTION FAILED: $last" ;;
|
|
|
|
*runtime\ error*) echo "RUNTIME ERROR (sanitizer): $last" ;;
|
2016-11-07 12:21:34 +00:00
|
|
|
*AddressSanitizer*heap-use-after-free*) echo "RUNTIME ERROR (use after free): $last" ;;
|
2017-08-30 14:56:23 +00:00
|
|
|
*LeakSanitizer:*leak*) echo "SANITIZER REPORT: memory leak: $last" ;;
|
2016-11-07 12:21:34 +00:00
|
|
|
*Warning:\ assertion*failed*) echo "ASSERTION WARNING: $last" ;;
|
2017-08-23 17:19:47 +00:00
|
|
|
*command\ not\ found*) echo "COMMAND NOT FOUND: $last" ;;
|
2022-08-30 19:28:41 +00:00
|
|
|
*extent\ buffer\ leak*) 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"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Scan all existing test logs
|
|
|
|
for file in *.txt; do
|
|
|
|
scan_log "$file"
|
2016-09-23 13:51:28 +00:00
|
|
|
done
|