Changeset 35454e27 in rtems


Ignore:
Timestamp:
Aug 7, 2008, 6:51:05 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
8ad2468c
Parents:
02d989c
Message:

2008-08-07 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

    r02d989c r35454e27  
     12008-08-07      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * runtest: Major update. Now more likely not to run away.
     4
    152008-08-05      Joel Sherrill <joel.sherrill@OARcorp.com>
    26
  • c/src/lib/libbsp/mips/jmr3904/tools/runtest

    r02d989c r35454e27  
    218218     # Spin off the simulator in the background
    219219
    220        ${simulator} --board=jmr3904 $tfile | \
    221          sed -e 's/
     220     ${simulator} --board=jmr3904 $tfile | \
     221       sed -e 's/
    222222//' -e '/^$/d' > ${logfile} 2>&1 &
    223        pid=$!
    224 
    225        # Make sure it won't run forever...
    226        time_run=0
    227        while [ $time_run -lt $max_run_time ]
    228        do
    229            # sleep 5s at a time waiting for job to finish or timer to expire
    230            # if job has exited, then we exit, too.
    231            sleep 5
    232            kill -0 $pid 2> /dev/null
    233            running=$?
    234            if [ $running -eq 0 ]
    235            then
    236                time_run=$((time_run + 5))
    237                if [ $time_run -ge $max_run_time ]
    238                then
    239                    kill -9 $pid 2> /dev/null
    240                    ran_too_long="yes"
    241                fi
    242            else
    243                ran_too_long="no"
    244                break
    245            fi
    246        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
    247260   fi
    248261
Note: See TracChangeset for help on using the changeset viewer.