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 548

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
# The argument is the list of log files to process.
28
 
29
tmpf=/tmp/check-results-$$
30
 
31
# Get the individual results if we have any. Note that we don't check for the
32
# strings at start of line, since they may have FTP prompts showing.
33
echo "                           PASS  FAIL XPASS XFAIL UNRES UNSUP UNTES TOTAL"
34
 
35
if ls $* > /dev/null 2>&1
36
then
37
    for logfile in $*
38
    do
39
        logfile_base=`basename ${logfile}`
40
        tname=`echo ${logfile_base} | sed -e 's/\.log//'`
41
        p=`grep 'PASS:' ${logfile} | grep -v 'XPASS' | wc -l`
42
        f=`grep 'FAIL:' ${logfile} | grep -v 'XFAIL' | wc -l`
43
        xp=`grep 'XPASS:' ${logfile} | wc -l`
44
        xf=`grep 'XFAIL:' ${logfile} | wc -l`
45
        ur=`grep 'UNRESOLVED:' ${logfile} | wc -l`
46
        us=`grep 'UNSUPPORTED:' ${logfile} | wc -l`
47
        ut=`grep 'UNTESTED:' ${logfile} | wc -l`
48
        tot=`echo "${p} ${f} + ${xp} + ${xf} + ${ur} + ${us} + ${ut} + p" | dc`
49
        printf "%-25s %5d %5d %5d %5d %5d %5d %5d %5d\n" \
50
            ${tname} ${p} ${f} ${xp} ${xf} ${ur} ${us} ${ut} ${tot} | \
51
            tee -a ${tmpf}
52
    done
53
fi
54
 
55
# Total each column, if we have any results
56
if ls $* > /dev/null 2>&1
57
then
58
    pt=`cut -c 27-31 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
59
    ft=`cut -c 33-37 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
60
    xpt=`cut -c 39-43 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
61
    xft=`cut -c 45-49 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
62
    urt=`cut -c 51-55 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
63
    ust=`cut -c 57-61 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
64
    utt=`cut -c 63-67 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
65
    tott=`cut -c 69-73 ${tmpf} | sed -e '2,$s/$/ +/' -e '$s/$/ p/' | dc`
66
else
67
    pt=0
68
    ft=0
69
    xpt=0
70
    xft=0
71
    urt=0
72
    ust=0
73
    utt=0
74
    tott=0
75
fi
76
 
77
rm -f ${tmpf}
78
 
79
echo "-----                     ----- ----- ----- ----- ----- ----- ----- -----"
80
printf "TOTAL                     %5d %5d %5d %5d %5d %5d %5d %5d\n" \
81
    ${pt} ${ft} ${xpt} ${xft} ${urt} ${ust} ${utt} ${tott}
82
 

powered by: WebSVN 2.1.0

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