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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [bin/] [parse_results] - Diff between revs 149 and 202

Show entire file | Details | Blame | View Log

Rev 149 Rev 202
Line 37... Line 37...
#                                                                             #
#                                                                             #
#                PARSE REGRESSION RESULTS IN THE LOG DIRECTORY                #
#                PARSE REGRESSION RESULTS IN THE LOG DIRECTORY                #
#                                                                             #
#                                                                             #
###############################################################################
###############################################################################
 
 
 
# Formating attributes
 
green=$(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 directory
 
if [ $# -ne 1 ]; then
 
    LOG_DIR=./log/0
 
else
 
    LOG_DIR=$1
 
fi
 
 
 
 
#----------------------------------------------------#
#----------------------------------------------------#
# Get numbers of PASSED/SKIPPED/FAILED/ABORDED tests #
# Get numbers of PASSED/SKIPPED/FAILED/ABORTED tests #
#----------------------------------------------------#
#----------------------------------------------------#
 
 
passed_nr="0"
passed_nr="0"
skipped_nr="0"
skipped_nr="0"
failed_nr="0"
failed_nr="0"
aborded_nr="0"
aborted_nr="0"
 
 
for file in ./log/*.log ; do
for file in $LOG_DIR/*.log ; do
    passed_ok=`grep -c PASSED $file`
    passed_ok=`grep -c PASSED $file`
    skipped_ok=`grep -c SKIPPED $file`
    skipped_ok=`grep -c SKIPPED $file`
    failed_ok=`grep -c FAILED $file`
    failed_ok=`grep -c FAILED $file`
 
 
    if [ $passed_ok == 1 ]; then
    if [ $passed_ok == 1 ]; then
        passed_nr=`expr $passed_nr + 1`
        passed_nr=`expr $passed_nr + 1`
    elif [ $skipped_ok == 1 ]; then
    elif [ $skipped_ok == 1 ]; then
        skipped_nr=`expr $skipped_nr + 1`
        skipped_nr=`expr $skipped_nr + 1`
    elif [ $failed_ok == 1 ]; then
    elif [ $failed_ok != 0 ]; then
        failed_nr=`expr $failed_nr + 1`
        failed_nr=`expr $failed_nr + 1`
    else
    else
        aborded_nr=`expr $aborded_nr + 1`
        aborted_nr=`expr $aborted_nr + 1`
    fi
    fi
done
done
 
 
#----------------------------------------------------#
#----------------------------------------------------#
# Display detailed report                            #
# Display detailed report                            #
#----------------------------------------------------#
#----------------------------------------------------#
echo ""
echo ""
echo "#----------------------------------------------------#"
echo "#====================================================================================================================================================#"
 
echo "#                                                                                                                                                    #"
echo "#                   DETAILED REPORT                  #"
echo "#                   DETAILED REPORT                  #"
echo "#----------------------------------------------------#"
echo "#                                                                                                                                                    #"
 
echo "#====================================================================================================================================================#"
 
echo "#                            ||           ||               ||  DMA IF TRANSFER  ||                                                                   #"
 
echo "#          TEST NAME         ||  RESULT   ||      SEED     ||-------------------||                              REPLAY COMMAND                       #"
 
echo "#                            ||           ||               ||  Total  |  Error  ||                                                                   #"
 
echo "#============================++===========++===============++=========+=========++===================================================================#"
 
echo "#                            ||           ||               ||         |         ||                                                                   #"
 
for file in $LOG_DIR/*.log ; do
 
    testname=`basename $file .log`
 
    passed_ok=`grep -c PASSED $file`
 
    skipped_ok=`grep -c SKIPPED $file`
 
    failed_ok=`grep -c FAILED $file`
 
    abort_ok=0
 
    if [ $passed_ok == 1 ]; then
 
        result="${green} PASSED  ${normal}"
 
        replay_color="${normal}"
 
    elif [ $skipped_ok == 1 ]; then
 
        result="${normal} SKIPPED ${normal}"
 
        replay_color="${normal}"
 
    elif [ $failed_ok != 0 ]; then
 
        result="${red} FAILED  ${normal}"
 
        replay_color="${red}"
 
    else
 
        result="${red} ABORTED ${normal}"
 
        replay_color="${red}"
 
        abort_ok=1
 
    fi
 
 
 
    seed=`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 ]; then
 
        if [ ${dma_error_arr[2]} -ne " 0" ]; then
 
            dma_error_arr[2]="${red}  ${dma_error_arr[2]} ${normal}"
 
        fi
 
    fi
 
    printf "#   %-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]}" $testname
 
done
 
echo "#                            ||           ||               ||         |         ||                                                                   #"
 
echo "#====================================================================================================================================================#"
 
echo ""
 
 
 
#----------------------------------------------------#
 
#        Display skipped and failed tests            #
 
#----------------------------------------------------#
 
echo ""
 
echo "#===================================================================#"
 
echo "#                          SKIPPED & FAILED TESTS                   #"
 
echo "#===================================================================#"
echo ""
echo ""
if [ $skipped_nr != 0 ]; then
if [ $skipped_nr != 0 ]; then
    echo " SKIPPED TESTS:"
    echo " SKIPPED TESTS:"
    for file in ./log/*.log ; do
    for file in $LOG_DIR/*.log ; do
        skipped_ok=`grep -c SKIPPED $file`
        skipped_ok=`grep -c SKIPPED $file`
        if [ $skipped_ok == 1 ]; then
        if [ $skipped_ok == 1 ]; then
            echo "               -  $file"
            echo "               -  $file"
        fi
        fi
    done
    done
fi
fi
echo ""
echo ""
if [ $failed_nr != 0 ]; then
if [ $failed_nr != 0 ]; then
    echo -e "\e[01;31m FAILED TESTS:\e[00m"
    echo "${red_bold} FAILED TESTS:${normal}"
    for file in ./log/*.log ; do
    for file in $LOG_DIR/*.log ; do
        failed_ok=`grep -c FAILED $file`
        failed_ok=`grep -c FAILED $file`
        if [ $failed_ok == 1 ]; then
        if [ $failed_ok != 0 ]; then
            echo -e "\e[01;31m               -  $file \e[00m"
            echo "${red_bold}                 -  $file ${normal}"
        fi
        fi
    done
    done
fi
fi
echo ""
echo ""
if [ $aborded_nr != 0 ]; then
if [ $aborted_nr != 0 ]; then
    echo -e "\e[01;31m ABORDED TESTS:\e[00m"
    echo  "${red_bold} ABORTED TESTS:${normal}"
    for file in ./log/*.log ; do
    for file in $LOG_DIR/*.log ; do
        passed_ok=`grep -c PASSED $file`
        passed_ok=`grep -c PASSED $file`
        if [ $passed_ok == 0 ]; then
        if [ $passed_ok == 0 ]; then
            failed_ok=`grep -c FAILED $file`
            failed_ok=`grep -c FAILED $file`
            if [ $failed_ok == 0 ]; then
            if [ $failed_ok == 0 ]; then
                skipped_ok=`grep -c SKIPPED $file`
                skipped_ok=`grep -c SKIPPED $file`
                if [ $skipped_ok == 0 ]; then
                if [ $skipped_ok == 0 ]; then
                    echo -e "\e[01;31m               -  $file \e[00m"
                    echo  "${red_bold}                 -  $file ${normal}"
                fi
                fi
            fi
            fi
        fi
        fi
    done
    done
fi
fi
Line 111... Line 180...
 
 
#----------------------------------------------------#
#----------------------------------------------------#
# Display summary report                             #
# Display summary report                             #
#----------------------------------------------------#
#----------------------------------------------------#
echo ""
echo ""
echo "#----------------------------------------------------#"
echo "#===================================================================#"
echo "#                    SUMMARY REPORT                  #"
echo "#                    SUMMARY REPORT                  #"
echo "#----------------------------------------------------#"
echo "#===================================================================#"
echo ""
echo ""
 
 
# Generate final report
# Generate final report
echo    "     +-----------------------------------"
echo    "     +-----------------------------------"
echo -e "     | Number of PASSED  tests :\e[01;32m $passed_nr \e[00m"
echo    "         | Number of PASSED  tests :${green_bold} $passed_nr ${normal}"
echo -e "     | Number of SKIPPED tests :\e[01;32m $skipped_nr \e[00m"
echo    "         | Number of SKIPPED tests :${green_bold} $skipped_nr ${normal}"
echo -e "     | Number of FAILED  tests :\e[01;31m $failed_nr \e[00m"
echo    "         | Number of FAILED  tests :${red_bold} $failed_nr ${normal}"
echo -e "     | Number of ABORDED tests :\e[01;31m $aborded_nr \e[00m"
echo    "         | Number of ABORTED tests :${red_bold} $aborted_nr ${normal}"
echo    "     |----------------------------------"
echo    "     |----------------------------------"
echo -n "     | Number of tests         : "
echo -n "     | Number of tests         : "
ls -1 ./log/*.log | wc -l
ls -1 $LOG_DIR/*.log | wc -l
echo    "     +----------------------------------"
echo    "     +----------------------------------"
echo    ""
echo    ""
echo    "      Make sure passed+skipped == total"
echo    "      Make sure passed+skipped == total"
echo    ""
echo    ""
echo    ""
echo    ""

powered by: WebSVN 2.1.0

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