URL
https://opencores.org/ocsvn/openmsp430/openmsp430/trunk
Subversion Repositories openmsp430
[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [bin/] [parse_results] - Rev 222
Go to most recent revision | Compare with Previous | Blame | View Log
#!/bin/bash#------------------------------------------------------------------------------# Copyright (C) 2001 Authors## This source file may be used and distributed without restriction provided# that this copyright statement is not removed from the file and that any# derivative work contains the original copyright notice and the associated# disclaimer.## This source file is free software; you can redistribute it and/or modify# it under the terms of the GNU Lesser General Public License as published# by the Free Software Foundation; either version 2.1 of the License, or# (at your option) any later version.## This source 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 Lesser General Public# License for more details.## You should have received a copy of the GNU Lesser General Public License# along with this source; if not, write to the Free Software Foundation,# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA##------------------------------------------------------------------------------## File Name: parse_results## Author(s):# - Olivier Girard, olgirard@gmail.com##------------------------------------------------------------------------------# $Rev: 138 $# $LastChangedBy: olivier.girard $# $LastChangedDate: 2012-04-23 13:10:00 +0200 (Mon, 23 Apr 2012) $#------------------------------------------------------------------------------################################################################################ ## PARSE REGRESSION RESULTS IN THE LOG DIRECTORY ## ################################################################################# Formating attributesgreen=$(tput setaf 2)green_bold=$(tput bold)$(tput setaf 2)red=$(tput setaf 1)red_bold=$(tput bold)$(tput setaf 1)normal=$(tput sgr0)# Specify log directoryif [ $# -ne 1 ]; thenLOG_DIR=./log/0elseLOG_DIR=$1fi#----------------------------------------------------## Get numbers of PASSED/SKIPPED/FAILED/ABORTED tests ##----------------------------------------------------#passed_nr="0"skipped_nr="0"failed_nr="0"aborted_nr="0"for file in $LOG_DIR/*.log ; dopassed_ok=`grep -c PASSED $file`skipped_ok=`grep -c SKIPPED $file`failed_ok=`grep -c FAILED $file`if [ $passed_ok == 1 ]; thenpassed_nr=`expr $passed_nr + 1`elif [ $skipped_ok == 1 ]; thenskipped_nr=`expr $skipped_nr + 1`elif [ $failed_ok != 0 ]; thenfailed_nr=`expr $failed_nr + 1`elseaborted_nr=`expr $aborted_nr + 1`fidone#----------------------------------------------------## Display detailed report ##----------------------------------------------------#echo ""echo "#====================================================================================================================================================#"echo "# #"echo "# DETAILED REPORT #"echo "# #"echo "#====================================================================================================================================================#"echo "# || || || DMA IF TRANSFER || #"echo "# TEST NAME || RESULT || SEED ||-------------------|| REPLAY COMMAND #"echo "# || || || Total | Error || #"echo "#============================++===========++===============++=========+=========++===================================================================#"echo "# || || || | || #"for file in $LOG_DIR/*.log ; dotestname=`basename $file .log`passed_ok=`grep -c PASSED $file`skipped_ok=`grep -c SKIPPED $file`failed_ok=`grep -c FAILED $file`abort_ok=0if [ $passed_ok == 1 ]; thenresult="${green} PASSED ${normal}"replay_color="${normal}"elif [ $skipped_ok == 1 ]; thenresult="${normal} SKIPPED ${normal}"replay_color="${normal}"elif [ $failed_ok != 0 ]; thenresult="${red} FAILED ${normal}"replay_color="${red}"elseresult="${red} ABORTED ${normal}"replay_color="${red}"abort_ok=1fiseed=`grep "SIMULATION SEED" $file`seed_arr=($seed)dma_total=`grep "DMA REPORT" $file`dma_total_arr=($dma_total)dma_error=`grep "Total Errors" $file`dma_error_arr=($dma_error)dma_error_arr[2]="${dma_error_arr[2]}"if [ $abort_ok == 0 ]; thenif [ ${dma_error_arr[2]} -ne " 0" ]; thendma_error_arr[2]="${red} ${dma_error_arr[2]} ${normal}"fifiprintf "# %-24s || %s || %12s || %6s | %4s || $replay_color../bin/msp430sim -seed %12s %-24s${normal} #\n" $testname "$result" " ${seed_arr[2]}" " ${dma_total_arr[4]}" "${dma_error_arr[2]}" " ${seed_arr[2]}" $testnamedoneecho "# || || || | || #"echo "#====================================================================================================================================================#"echo ""#----------------------------------------------------## Display skipped and failed tests ##----------------------------------------------------#echo ""echo "#===================================================================#"echo "# SKIPPED & FAILED TESTS #"echo "#===================================================================#"echo ""if [ $skipped_nr != 0 ]; thenecho " SKIPPED TESTS:"for file in $LOG_DIR/*.log ; doskipped_ok=`grep -c SKIPPED $file`if [ $skipped_ok == 1 ]; thenecho " - $file"fidonefiecho ""if [ $failed_nr != 0 ]; thenecho "${red_bold} FAILED TESTS:${normal}"for file in $LOG_DIR/*.log ; dofailed_ok=`grep -c FAILED $file`if [ $failed_ok != 0 ]; thenecho "${red_bold} - $file ${normal}"fidonefiecho ""if [ $aborted_nr != 0 ]; thenecho "${red_bold} ABORTED TESTS:${normal}"for file in $LOG_DIR/*.log ; dopassed_ok=`grep -c PASSED $file`if [ $passed_ok == 0 ]; thenfailed_ok=`grep -c FAILED $file`if [ $failed_ok == 0 ]; thenskipped_ok=`grep -c SKIPPED $file`if [ $skipped_ok == 0 ]; thenecho "${red_bold} - $file ${normal}"fififidonefiecho ""#----------------------------------------------------## Display summary report ##----------------------------------------------------#echo ""echo "#===================================================================#"echo "# SUMMARY REPORT #"echo "#===================================================================#"echo ""# Generate final reportecho " +-----------------------------------"echo " | Number of PASSED tests :${green_bold} $passed_nr ${normal}"echo " | Number of SKIPPED tests :${green_bold} $skipped_nr ${normal}"echo " | Number of FAILED tests :${red_bold} $failed_nr ${normal}"echo " | Number of ABORTED tests :${red_bold} $aborted_nr ${normal}"echo " |----------------------------------"echo -n " | Number of tests : "ls -1 $LOG_DIR/*.log | wc -lecho " +----------------------------------"echo ""echo " Make sure passed+skipped == total"echo ""echo ""
Go to most recent revision | Compare with Previous | Blame | View Log
