File: scan-results.sh

package info (click to toggle)
btrfs-progs 6.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,596 kB
  • sloc: ansic: 127,198; sh: 7,836; python: 1,385; makefile: 900; asm: 296
file content (39 lines) | stat: -rwxr-xr-x 980 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Look for some frequent error message templates in test logs
#
# Usage: $0 [test-log.txt]

ret=0

scan_log() {
	local file="$1"

	echo "Scanning $file"
	last=
	while read line; do
		case "$line" in
			===\ 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" ;;
			*) : ;;
		esac
	done < "$file"
}

# Scan only the given file
if [ -n "$1" ]; then
	scan_log "$1"
	exit "$ret"
fi

# Scan all existing test logs
for file in *.txt; do
	scan_log "$file"
done

exit "$ret"