run_mtc_simu.bash 1.27 KB
Newer Older
Yann Garcia's avatar
Yann Garcia committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#!/bin/bash
#set -evx

clear

CURPWD=`pwd`
if [ ! "${PWD##*/}" == "objs" ]
then
    cd ../objs
    if [ ! $? == 0 ]
    then
        echo "Please move to PROJECT/obj directory"
        exit 1
    fi
fi

TITAN_LOG_DIR=../logs/simu
if [ ! -d ${TITAN_LOG_DIR} ]
then
    mkdir ${TITAN_LOG_DIR}
else
    rm -f ${TITAN_LOG_DIR}/*.log
fi

CFG_FILES=../etc/simu/AtsNg112.cfg
#LOG_FILES=`find ${TITAN_LOG_DIR} -name '*.log'`
#mv ${LOG_FILES} ../logs

#if [ "${OSTYPE}" == "cygwin" ]
#then
#    # Remove dll
#    rm ./*.dll
#    ## Copy the new ones
#    cp ~/lib/libhelper.dll .
#    cp ~/lib/libconverter.dll .
#    cp ~/lib/liblogger.dll .
#    cp ~/lib/libttcn3_tri.dll .
#    cp ~/lib/libcomm.dll .
#fi

echo "> cmtc: to create the MTC server"
echo "> smtc [module_name[[.control]|.testcase_name|.*]: when MyExample is connected, run the TCs in [EXECUTE] section"
echo "> emtc: Terminate MTC."
mctr ${CFG_FILES}

LOG_FILES=`find ${TITAN_LOG_DIR} -name '*.log'`
if [ "${TITAN_LOG_DIR}" != "" ]
then
    ttcn3_logmerge -o ${TITAN_LOG_DIR}/merged.log ${LOG_FILES}
    ttcn3_logformat -o ${TITAN_LOG_DIR}/merged_formated.log ${TITAN_LOG_DIR}/merged.log
    mv ${TITAN_LOG_DIR}/merged_formated.log ${TITAN_LOG_DIR}/merged.log    
    echo "log files were merged into ${TITAN_LOG_DIR}/merged.log"
fi

cd ${CURPWD}