OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [check-results.sh] - Blame information for rev 631

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 548 jeremybenn
#!/bin/bash
2
 
3
# Copyright (C) 2010 Embecosm Limited
4
 
5
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
6
 
7
# This file is a script to count the results from a set of test directories.
8
 
9
# This program is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by the Free
11
# Software Foundation; either version 3 of the License, or (at your option)
12
# any later version.
13
 
14
# This program is distributed in the hope that it will be useful, but WITHOUT
15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
17
# more details.
18
 
19
# You should have received a copy of the GNU General Public License along
20
# with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 
22
# ------------------------------------------------------------------------------
23
 
24
# Look for the different GNU results in different directories. We put the
25
# results to a temporary file, to allow us to suck out the summary as well.
26
 
27 565 jeremybenn
# The argument is the list of log files to process. It may optionally start
28
# with -d, indicating that the name of the test is the last directory name,
29
# not the tool and/or -a to indicate that tests with zero results should be
30
# included.
31 548 jeremybenn
 
32
tmpf=/tmp/check-results-$$
33
 
34 565 jeremybenn
# Check for flags
35
usedir="false"
36
showall="false"
37
until
38
complete="false"
39
case $1
40
    in
41
    -d)
42
        usedir="true"
43
        shift
44
        ;;
45
 
46
    -a)
47
        showall="true"
48
        shift
49
        ;;
50
 
51
    *)
52
        complete="true"
53
        ;;
54
esac;
55
[ "true" == "${complete}" ]
56
do
57
    continue
58
done
59
 
60 548 jeremybenn
# Get the individual results if we have any. Note that we don't check for the
61 553 jeremybenn
# strings at start of line, since they may have FTP prompts showing. Don't
62
# print out lines which have no tests at all.
63 548 jeremybenn
echo "                           PASS  FAIL XPASS XFAIL UNRES UNSUP UNTES TOTAL"
64
 
65
if ls $* > /dev/null 2>&1
66
then
67
    for logfile in $*
68
    do
69 565 jeremybenn
        if [ "${usedir}" == "true" ]
70
        then
71
            dir=`dirname ${logfile}`
72
            tname=`basename ${dir}`
73
        else
74
            logfile_base=`basename ${logfile}`
75
            tname=`echo ${logfile_base} | sed -e 's/\.log//'`
76
        fi
77
 
78 548 jeremybenn
        p=`grep 'PASS:' ${logfile} | grep -v 'XPASS' | wc -l`
79
        f=`grep 'FAIL:' ${logfile} | grep -v 'XFAIL' | wc -l`
80
        xp=`grep 'XPASS:' ${logfile} | wc -l`
81
        xf=`grep 'XFAIL:' ${logfile} | wc -l`
82
        ur=`grep 'UNRESOLVED:' ${logfile} | wc -l`
83
        us=`grep 'UNSUPPORTED:' ${logfile} | wc -l`
84
        ut=`grep 'UNTESTED:' ${logfile} | wc -l`
85
        tot=`echo "${p} ${f} + ${xp} + ${xf} + ${ur} + ${us} + ${ut} + p" | dc`
86 553 jeremybenn
 
87 565 jeremybenn
        if [ "${showall}" == "true" -o "x${tot}" != "x0" ]
88 553 jeremybenn
        then
89
            printf "%-25s %5d %5d %5d %5d %5d %5d %5d %5d\n" \
90
                ${tname} ${p} ${f} ${xp} ${xf} ${ur} ${us} ${ut} ${tot} | \
91
                tee -a ${tmpf}
92
        fi
93 548 jeremybenn
    done
94
fi
95
 
96
# Total each column, if we have any results
97
if ls $* > /dev/null 2>&1
98
then
99
    pt=`cut -c 27-31 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
100
    ft=`cut -c 33-37 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
101
    xpt=`cut -c 39-43 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
102
    xft=`cut -c 45-49 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
103
    urt=`cut -c 51-55 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
104
    ust=`cut -c 57-61 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
105
    utt=`cut -c 63-67 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
106
    tott=`cut -c 69-73 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
107
else
108
    pt=0
109
    ft=0
110
    xpt=0
111
    xft=0
112
    urt=0
113
    ust=0
114
    utt=0
115
    tott=0
116
fi
117
 
118
rm -f ${tmpf}
119
 
120
echo "-----                     ----- ----- ----- ----- ----- ----- ----- -----"
121
printf "TOTAL                     %5d %5d %5d %5d %5d %5d %5d %5d\n" \
122
    ${pt} ${ft} ${xpt} ${xft} ${urt} ${ust} ${utt} ${tott}
123
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.