Changeset 3c59390 in rtems


Ignore:
Timestamp:
Aug 12, 2008, 1:05:08 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.8
Children:
c657ad5
Parents:
77c5e912
Message:

2008-08-11 Joel Sherrill <joel.sherrill@…>

  • runtest: Major update. Now more likely not to run away.
Location:
c/src/lib/libbsp/mips/jmr3904/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/mips/jmr3904/tools/ChangeLog

    r77c5e912 r3c59390  
     12008-08-11      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * runtest: Major update. Now more likely not to run away.
     4
    152007-09-04      Joel Sherrill <joel.sherrill@OARcorp.com>
    26
  • c/src/lib/libbsp/mips/jmr3904/tools/runtest

    r77c5e912 r3c59390  
    8686max_run_time=$((5 * 60))
    8787using_print_buffer="yes"
    88 simulator=mipstx39-rtems4.8-run
     88simulator=mipstx39-rtems4.9-run
    8989
    9090while getopts vdl:o:s: OPT
     
    143143
    144144   tname=`basename $tfile .exe`
     145   tname=`basename $tname .ralf`
    145146   cpus="1"
    146147   TEST_TYPE="single"
     
    164165           TEST_TYPE="mp"
    165166           ;;
    166        minimum*|stackchk*|spfatal*|termio*)
     167       minimum*|stackchk*|*fatal*|termio*)
    167168           continue
    168169           ;;
     
    217218     # Spin off the simulator in the background
    218219
    219        ${simulator} --board=jmr3904 $tfile | \
    220          sed -e 's/
     220     ${simulator} --board=jmr3904 $tfile | \
     221       sed -e 's/
    221222//' -e '/^$/d' > ${logfile} 2>&1 &
    222        pid=$!
    223 
    224        # Make sure it won't run forever...
    225        time_run=0
    226        while [ $time_run -lt $max_run_time ]
    227        do
    228            # sleep 5s at a time waiting for job to finish or timer to expire
    229            # if job has exited, then we exit, too.
    230            sleep 5
    231            kill -0 $pid 2> /dev/null
    232            running=$?
    233            if [ $running -eq 0 ]
    234            then
    235                time_run=$((time_run + 5))
    236                if [ $time_run -ge $max_run_time ]
    237                then
    238                    kill -9 $pid 2> /dev/null
    239                    ran_too_long="yes"
    240                fi
    241            else
    242                ran_too_long="no"
    243                break
    244            fi
    245        done
     223     pid=$!
     224
     225     # Make sure it won't run forever...
     226     millilimit=`expr ${max_run_time} \* 1000`
     227     milliseconds=0
     228     while :
     229     do
     230       # sleep 10ms at a time waiting for job to finish or timer to expire
     231       # if job has exited, then we exit, too.
     232       usleep 10000  # ten milliseconds
     233       milliseconds=`expr ${milliseconds} + 10`
     234       kill -0 $pid 2> /dev/null
     235       running=$?
     236       if [ $running -eq 0 ] ; then
     237         if [ ${milliseconds} -ge ${millilimit} ]; then
     238           kill -9 $pid 2> /dev/null
     239           cat ${logfile}
     240           echo "${testname} killed after running ${max_run_time} seconds"
     241           break
     242         fi
     243         grep "^Unhandled exception" ${logfile} >/dev/null
     244         exceptionExit=$?
     245         grep "^mips-core: " ${logfile} >/dev/null
     246         badAccessExit=$?
     247         if [ $badAccessExit -eq 0 -o $exceptionExit -eq 0 ] ; then
     248           kill -9 ${pid} >/dev/null 2>&1
     249           cat ${logfile}
     250           echo Ran in ${milliseconds} milliseconds
     251         fi
     252
     253       else
     254         # done normally
     255         cat ${logfile}
     256         echo "${testname} ran in ${milliseconds} milliseconds"
     257         break
     258       fi
     259     done
    246260   fi
    247261
Note: See TracChangeset for help on using the changeset viewer.