File: summarize.sh

package info (click to toggle)
syncmaildir 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,104 kB
  • sloc: ansic: 6,643; sh: 1,780; makefile: 247
file content (60 lines) | stat: -rwxr-xr-x 1,233 bytes parent folder | download | duplicates (7)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh

echo
echo --- client-server summary -----------------------------------------------
echo

ROOT=$BASE/tests.d/run/client-server

check_bin() {
	if which $1 >/dev/null; then
		return
	else
		echo $1 not installed
		exit 1
	fi
}

check_bin combine
check_bin grep
check_bin cut
check_bin sed
check_bin awk
check_bin sort

PATHS=`grep TRACE $ROOT/[0-9]*/log.client* | cut -d '|' -f 1 | cut -d : -f 2- | sort -u | wc -l`

echo
echo "Tested $PATHS paths"
echo

grep TRACE $ROOT/[0-9]*/log.client* \
	| sort -u | sed 's?^.*/\([^/]*\):?\1:?' | sed 's/TRACE://'

echo
echo "Surely missing leaves (there may be more paths for the same leaf):"
echo

tmpa=`mktemp`
tmpb=`mktemp`

grep -n 'return *( *trace' $BASE/smd-client \
	| cut -d : -f 1 | sed 's/ //g' > $tmpa
grep TRACE $ROOT/[0-9]*/log.client* \
	| sort -u | cut -d : -f 4 \
	| cut -d \| -f 1 | sed 's/ //g' > $tmpb
for N in `combine $tmpa not $tmpb`; do
	awk \
	"{L++} L==$N {\$1=\$2=\$3=\"\";print \"smd-client: \" L \":\" \$0 }" \
	$BASE/smd-client
done
rm $tmpa $tmpb

echo
echo "Generated tags:"
echo
grep ^TAG $ROOT/[0-9]*/log.client* \
	| cut -d : -f 2- | cut -d \( -f 1 | sort -u
echo
echo -------------------------------------------------------------------------
echo