Ignore:
Timestamp:
05/11/01 13:01:49 (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
9c0bd65
Parents:
c8f7f94b
Message:

2001-05-11 Joel Sherrill <joel@…>

  • tools/runtest: Add functionality to avoid letting simulator run too long.
File:
1 edited

Legend:

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

    rc8f7f94b rd8e0a60  
    216216
    217217     # Spin off the simulator in the background
    218      #   -c sets an instruction limit
    219 
    220      # XXX need to make sure it won't run forever...
    221 
    222      ${simulator} --board=jmr3904 $tfile | \
     218
     219       ${simulator} --board=jmr3904 $tfile | \
    223220         sed -e 's/
    224 //' -e '/^$/d' > ${logfile}
     221//' -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
    225246   fi
    226247
Note: See TracChangeset for help on using the changeset viewer.