2001-05-11 Joel Sherrill <joel@OARcorp.com>

* tools/runtest: Add functionality to avoid letting simulator
	run too long.
This commit is contained in:
Joel Sherrill
2001-05-11 13:01:49 +00:00
parent c8f7f94b4e
commit d8e0a60b9b
2 changed files with 30 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
2001-05-11 Joel Sherrill <joel@OARcorp.com>
* tools/runtest: Add functionality to avoid letting simulator
run too long.
2001-04-20 Joel Sherrill <joel@OARcorp.com>
* include/bsp.h (Clear_tm27_intr): Stop the timer and disable

View File

@@ -213,12 +213,33 @@ do
then
fatal "Cannot currently generate device files"
fi
# -c sets an instruction limit
# Spin off the simulator in the background
${simulator} --board=jmr3904 $tfile | \
sed -e 's/
# XXX need to make sure it won't run forever...
//' -e '/^$/d' > ${logfile} 2>&1 &
pid=$!
# Make sure it won't run forever...
time_run=0
while [ $time_run -lt $max_run_time ]
do
# sleep 5s at a time waiting for job to finish or timer to expire
# if job has exited, then we exit, too.
sleep 5
kill -0 $pid 2> /dev/null
running=$?
if [ $running -eq 0 ]
then
time_run=$((time_run + 5))
if [ $time_run -ge $max_run_time ]
then
kill -9 $pid 2> /dev/null
ran_too_long="yes"
fi
else
ran_too_long="no"
break
fi
done