OpenCores
URL https://opencores.org/ocsvn/openmsp430/openmsp430/trunk

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [bin/] [parse_results] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 olivier.gi
#!/bin/bash
2
#------------------------------------------------------------------------------
3
# Copyright (C) 2001 Authors
4
#
5
# This source file may be used and distributed without restriction provided
6
# that this copyright statement is not removed from the file and that any
7
# derivative work contains the original copyright notice and the associated
8
# disclaimer.
9
#
10
# This source file is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU Lesser General Public License as published
12
# by the Free Software Foundation; either version 2.1 of the License, or
13
# (at your option) any later version.
14
#
15
# This source is distributed in the hope that it will be useful, but WITHOUT
16
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18
# License for more details.
19
#
20
# You should have received a copy of the GNU Lesser General Public License
21
# along with this source; if not, write to the Free Software Foundation,
22
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23
#
24
#------------------------------------------------------------------------------
25
#
26
# File Name: parse_results
27
#
28
# Author(s):
29
#             - Olivier Girard,    olgirard@gmail.com
30
#
31
#------------------------------------------------------------------------------
32
# $Rev: 138 $
33
# $LastChangedBy: olivier.girard $
34
# $LastChangedDate: 2012-04-23 13:10:00 +0200 (Mon, 23 Apr 2012) $
35
#------------------------------------------------------------------------------
36
###############################################################################
37
#                                                                             #
38
#                PARSE REGRESSION RESULTS IN THE LOG DIRECTORY                #
39
#                                                                             #
40
###############################################################################
41
 
42
#----------------------------------------------------#
43
# Get numbers of PASSED/SKIPPED/FAILED/ABORDED tests #
44
#----------------------------------------------------#
45
 
46
passed_nr="0"
47
skipped_nr="0"
48
failed_nr="0"
49
aborded_nr="0"
50
 
51
for file in ./log/*.log ; do
52
    passed_ok=`grep -c PASSED $file`
53
    skipped_ok=`grep -c SKIPPED $file`
54
    failed_ok=`grep -c FAILED $file`
55
 
56
    if [ $passed_ok == 1 ]; then
57
        passed_nr=`expr $passed_nr + 1`
58
    elif [ $skipped_ok == 1 ]; then
59
        skipped_nr=`expr $skipped_nr + 1`
60
    elif [ $failed_ok == 1 ]; then
61
        failed_nr=`expr $failed_nr + 1`
62
    else
63
        aborded_nr=`expr $aborded_nr + 1`
64
    fi
65
done
66
 
67
#----------------------------------------------------#
68
# Display detailed report                            #
69
#----------------------------------------------------#
70
echo ""
71
echo "#----------------------------------------------------#"
72
echo "#                   DETAILED REPORT                  #"
73
echo "#----------------------------------------------------#"
74
echo ""
75
if [ $skipped_nr != 0 ]; then
76
    echo " SKIPPED TESTS:"
77
    for file in ./log/*.log ; do
78
        skipped_ok=`grep -c SKIPPED $file`
79
        if [ $skipped_ok == 1 ]; then
80
            echo "               -  $file"
81
        fi
82
    done
83
fi
84
echo ""
85
if [ $failed_nr != 0 ]; then
86
    echo -e "\e[01;31m FAILED TESTS:\e[00m"
87
    for file in ./log/*.log ; do
88
        failed_ok=`grep -c FAILED $file`
89
        if [ $failed_ok == 1 ]; then
90
            echo -e "\e[01;31m               -  $file \e[00m"
91
        fi
92
    done
93
fi
94
echo ""
95
if [ $aborded_nr != 0 ]; then
96
    echo -e "\e[01;31m ABORDED TESTS:\e[00m"
97
    for file in ./log/*.log ; do
98
        passed_ok=`grep -c PASSED $file`
99
        if [ $passed_ok == 0 ]; then
100
            failed_ok=`grep -c FAILED $file`
101
            if [ $failed_ok == 0 ]; then
102
                skipped_ok=`grep -c SKIPPED $file`
103
                if [ $skipped_ok == 0 ]; then
104
                    echo -e "\e[01;31m               -  $file \e[00m"
105
                fi
106
            fi
107
        fi
108
    done
109
fi
110
echo ""
111
 
112
#----------------------------------------------------#
113
# Display summary report                             #
114
#----------------------------------------------------#
115
echo ""
116
echo "#----------------------------------------------------#"
117
echo "#                    SUMMARY REPORT                  #"
118
echo "#----------------------------------------------------#"
119
echo ""
120
 
121
# Generate final report
122
echo    "     +-----------------------------------"
123
echo -e "     | Number of PASSED  tests :\e[01;32m $passed_nr \e[00m"
124
echo -e "     | Number of SKIPPED tests :\e[01;32m $skipped_nr \e[00m"
125
echo -e "     | Number of FAILED  tests :\e[01;31m $failed_nr \e[00m"
126
echo -e "     | Number of ABORDED tests :\e[01;31m $aborded_nr \e[00m"
127
echo    "     |----------------------------------"
128
echo -n "     | Number of tests         : "
129
ls -1 ./log/*.log | wc -l
130
echo    "     +----------------------------------"
131
echo    ""
132
echo    "      Make sure passed+skipped == total"
133
echo    ""
134
echo    ""

powered by: WebSVN 2.1.0

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