forked from foss-for-synopsys-dwc-arc-processors/toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check-results.sh
executable file
·127 lines (106 loc) · 3.8 KB
/
check-results.sh
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/sh
# Copyright (C) 2010-2013 Embecosm Limited
# Contributor Jeremy Bennett <[email protected]>
# This file is a script to count the results from a set of test directories.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# ------------------------------------------------------------------------------
# Look for the different GNU results in different directories. We put the
# results to a temporary file, to allow us to suck out the summary as well.
# The argument is the list of log files to process. It may optionally start
# with -d, indicating that the name of the test is the last directory name,
# not the tool and/or -a to indicate that tests with zero results should be
# included.
tmpf=/tmp/check-results-$$
# Check for flags
usedir="false"
showall="false"
until
complete="false"
case $1
in
-d)
usedir="true"
shift
;;
-a)
showall="true"
shift
;;
*)
complete="true"
;;
esac;
[ "true" = "${complete}" ]
do
continue
done
# Get the individual results if we have any. Note that we don't check for the
# strings at start of line, since they may have FTP prompts showing. Don't
# print out lines which have no tests at all.
echo " PASS FAIL XPASS XFAIL KFAIL UNRES UNSUP UNTES TOTAL"
if ls $* > /dev/null 2>&1
then
for logfile in $*
do
if [ "${usedir}" = "true" ]
then
dir=`dirname ${logfile}`
tname=`basename ${dir}`
else
logfile_base=`basename ${logfile}`
tname=`echo ${logfile_base} | sed -e 's/\.log//'`
fi
p=`grep 'PASS:' ${logfile} | grep -v 'XPASS' | wc -l`
f=`grep 'FAIL:' ${logfile} | grep -v 'XFAIL' | grep -v 'KFAIL' | wc -l`
xp=`grep 'XPASS:' ${logfile} | wc -l`
xf=`grep 'XFAIL:' ${logfile} | wc -l`
kf=`grep 'KFAIL:' ${logfile} | wc -l`
ur=`grep 'UNRESOLVED:' ${logfile} | wc -l`
us=`grep 'UNSUPPORTED:' ${logfile} | wc -l`
ut=`grep 'UNTESTED:' ${logfile} | wc -l`
tot=`echo "${p} ${f} + ${xp} + ${xf} + ${ur} + ${us} + ${ut} + p" | dc`
if [ "${showall}" = "true" -o "x${tot}" != "x0" ]
then
printf "%-23s %6d %5d %5d %5d %5d %5d %5d %5d %6d\n" \
${tname} ${p} ${f} ${xp} ${xf} ${kf} ${ur} ${us} ${ut} ${tot} | \
tee -a ${tmpf}
fi
done
fi
# Total each column, if we have any results
if ls $* > /dev/null 2>&1
then
pt=`cut -c 25-30 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
ft=`cut -c 32-36 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
xpt=`cut -c 38-42 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
xft=`cut -c 44-48 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
kft=`cut -c 50-54 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
urt=`cut -c 56-60 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
ust=`cut -c 62-66 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
utt=`cut -c 68-72 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
tott=`cut -c 74-79 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
else
pt=0
ft=0
xpt=0
xft=0
kft=0
urt=0
ust=0
utt=0
tott=0
fi
rm -f ${tmpf}
echo "----- ------ ----- ----- ----- ----- ----- ----- ----- ------"
printf "TOTAL %6d %5d %5d %5d %5d %5d %5d %5d %6d\n" \
${pt} ${ft} ${xpt} ${xft} ${kft} ${urt} ${ust} ${utt} ${tott}
# vim: noexpandtab sts=4 ts=8: