forked from Imagelibrary/rtems
2008-08-07 Joel Sherrill <joel.sherrill@OARcorp.com>
* runtest: Major update. Now more likely not to run away.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2008-08-07 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* runtest: Major update. Now more likely not to run away.
|
||||
|
||||
2008-08-05 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* runtest: Strip .exe or .ralf from file names.
|
||||
|
||||
@@ -220,24 +220,37 @@ do
|
||||
${simulator} --board=jmr3904 $tfile | \
|
||||
sed -e 's/
|
||||
//' -e '/^$/d' > ${logfile} 2>&1 &
|
||||
pid=$!
|
||||
|
||||
pid=$!
|
||||
|
||||
# Make sure it won't run forever...
|
||||
millilimit=`expr ${max_run_time} \* 1000`
|
||||
time_run=0
|
||||
milliseconds=0
|
||||
while :
|
||||
do
|
||||
do
|
||||
# sleep 10ms at a time waiting for job to finish or timer to expire
|
||||
# if job has exited, then we exit, too.
|
||||
usleep 10000 # ten milliseconds
|
||||
sleep 5
|
||||
kill -0 $pid 2> /dev/null
|
||||
running=$?
|
||||
if [ $running -eq 0 ]
|
||||
then
|
||||
milliseconds=`expr ${milliseconds} + 10`
|
||||
kill -0 $pid 2> /dev/null
|
||||
running=$?
|
||||
if [ $time_run -ge $max_run_time ]
|
||||
if [ $running -eq 0 ] ; then
|
||||
if [ ${milliseconds} -ge ${millilimit} ]; then
|
||||
kill -9 $pid 2> /dev/null
|
||||
cat ${logfile}
|
||||
echo "${testname} killed after running ${max_run_time} seconds"
|
||||
break
|
||||
fi
|
||||
grep "^Unhandled exception" ${logfile} >/dev/null
|
||||
exceptionExit=$?
|
||||
grep "^mips-core: " ${logfile} >/dev/null
|
||||
badAccessExit=$?
|
||||
if [ $badAccessExit -eq 0 -o $exceptionExit -eq 0 ] ; then
|
||||
kill -9 ${pid} >/dev/null 2>&1
|
||||
cat ${logfile}
|
||||
echo Ran in ${milliseconds} milliseconds
|
||||
ran_too_long="yes"
|
||||
fi
|
||||
|
||||
else
|
||||
# done normally
|
||||
cat ${logfile}
|
||||
echo "${testname} ran in ${milliseconds} milliseconds"
|
||||
|
||||
Reference in New Issue
Block a user