forked from Imagelibrary/rtems
2009-01-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* psim-shared: Add catching a hardware exception and assertion as reasons to kill simulator.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2009-01-05 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* psim-shared: Add catching a hardware exception and assertion as
|
||||||
|
reasons to kill simulator.
|
||||||
|
|
||||||
2008-12-05 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2008-12-05 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* psim-shared, runtest-bottom: Tidy up more bugs.
|
* psim-shared, runtest-bottom: Tidy up more bugs.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ gen_device_tree()
|
|||||||
value=-1 # for now assume we are slave in this mode
|
value=-1 # for now assume we are slave in this mode
|
||||||
else
|
else
|
||||||
case ${1} in
|
case ${1} in
|
||||||
*mp*)
|
*node*)
|
||||||
enable_sysv_devices="yes"
|
enable_sysv_devices="yes"
|
||||||
case ${1} in
|
case ${1} in
|
||||||
*node1*) value=1 ;;
|
*node1*) value=1 ;;
|
||||||
@@ -88,15 +88,16 @@ runone()
|
|||||||
#echo run ${testname} forever
|
#echo run ${testname} forever
|
||||||
${RUN} -f ${treefile} ${RUN_DEBUG} ${testname}
|
${RUN} -f ${treefile} ${RUN_DEBUG} ${testname}
|
||||||
else
|
else
|
||||||
|
log=`echo ${testname} | sed -e 's/.exe$/.log/' -e 's/.ralf$/.log/'`
|
||||||
#echo run ${testname} for maximum ${max_run_time} seconds
|
#echo run ${testname} for maximum ${max_run_time} seconds
|
||||||
${RUN} -f ${treefile} ${RUN_DEBUG} ${testname} &
|
${RUN} -f ${treefile} ${RUN_DEBUG} ${testname} >${log} 2>&1 &
|
||||||
pid=$!
|
pid=$!
|
||||||
|
|
||||||
# Make sure it won't run forever...
|
# Make sure it won't run forever...
|
||||||
time_run=0
|
time_run=0
|
||||||
while [ $time_run -lt $max_run_time ]
|
while [ $time_run -lt $max_run_time ]
|
||||||
do
|
do
|
||||||
# sleep 5s at a time waiting for job to finish or timer to expire
|
# sleep 1s at a time waiting for job to finish or timer to expire
|
||||||
# if job has exited, then we exit, too.
|
# if job has exited, then we exit, too.
|
||||||
sleep 1
|
sleep 1
|
||||||
kill -0 $pid 2> /dev/null
|
kill -0 $pid 2> /dev/null
|
||||||
@@ -108,11 +109,24 @@ runone()
|
|||||||
ran_too_long="yes"
|
ran_too_long="yes"
|
||||||
echo "${testname} killed after running ${max_run_time} seconds"
|
echo "${testname} killed after running ${max_run_time} seconds"
|
||||||
fi
|
fi
|
||||||
|
grep "Suspending faulting task" ${log} >/dev/null 2>&1
|
||||||
|
Fault=$?
|
||||||
|
grep "assertion failed" ${log} >/dev/null 2>&1
|
||||||
|
Assert=$?
|
||||||
|
if [ $Fault -eq 0 -o $Assert -eq 0 ] ; then
|
||||||
|
kill -9 $pid 2> /dev/null
|
||||||
|
echo "${testname} failed after ${max_run_time} seconds"
|
||||||
|
ran_too_long="no"
|
||||||
|
break
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
ran_too_long="no"
|
ran_too_long="no"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
cat ${log}
|
||||||
|
rm -f ${log}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user