diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-24 19:14:35 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-24 19:14:35 +0000 |
commit | eee058b952cd21c7cb6ea18d2ccfdad67e49dfe7 (patch) | |
tree | c6a8af25de1baa2281452b5fe75075828eb17dbf /sim-scripts | |
parent | ff72703a77f5e1aa2c9cd722a763b8fb786fbea4 (diff) |
2009-09-24 Joel Sherrill <joel.sherrill@OARcorp.com>
* gdb-sim-run.in, qemu-rtems.in, skyeye-support, smdk2410.in: Add more
general support for rerunning a test which does not appear to have
produced a complete set of coherent output.
Diffstat (limited to 'sim-scripts')
-rw-r--r-- | sim-scripts/ChangeLog | 6 | ||||
-rwxr-xr-x | sim-scripts/gdb-sim-run.in | 53 | ||||
-rw-r--r-- | sim-scripts/qemu-rtems.in | 17 | ||||
-rw-r--r-- | sim-scripts/skyeye-support | 12 | ||||
-rw-r--r-- | sim-scripts/smdk2410.in | 2 |
5 files changed, 65 insertions, 25 deletions
diff --git a/sim-scripts/ChangeLog b/sim-scripts/ChangeLog index e7c920f..5a25e16 100644 --- a/sim-scripts/ChangeLog +++ b/sim-scripts/ChangeLog @@ -1,5 +1,11 @@ 2009-09-24 Joel Sherrill <joel.sherrill@OARcorp.com> + * gdb-sim-run.in, qemu-rtems.in, skyeye-support, smdk2410.in: Add more + general support for rerunning a test which does not appear to have + produced a complete set of coherent output. + +2009-09-24 Joel Sherrill <joel.sherrill@OARcorp.com> + * gdb-sim-run.in, qemu-rtems.in: Minor cleanup. Remove bogus output. 2009-09-23 Joel Sherrill <joel.sherrill@oarcorp.com> diff --git a/sim-scripts/gdb-sim-run.in b/sim-scripts/gdb-sim-run.in index 4b5ae40..fcb9c6d 100755 --- a/sim-scripts/gdb-sim-run.in +++ b/sim-scripts/gdb-sim-run.in @@ -255,6 +255,18 @@ catLog() echo } +get_tname() +{ + echo $1 | grep "exe$" >/dev/null + if [ $? -eq 0 ] ; then + ext=.exe + else + ext=.ralf + fi + tfile=`basename $1` + echo `basename $tfile ${ext}` +} + runtest() { testname=${1} @@ -274,13 +286,7 @@ runtest() echo Running ${testname} for maximum ${max_run_time} seconds echo $testname | grep "exe$" >/dev/null - if [ $? -eq 0 ] ; then - ext=.exe - else - ext=.ralf - fi - tfile=`basename $testname` - tname=`basename $tfile ${ext}` + tname=`get_tname $testname` logfile=${logdir}/${tname} @@ -414,24 +420,25 @@ do test ${verbose} = "yes" && \ echo BACKGROUND runtest ${toRun} ${testtype} ${limit} runtest ${toRun} ${testtype} ${limit} - if [ ${coverage} = "yes" ] ; then - - # some simulators do not always write a coverage file with non-zero length - # If we see this, try again - if [ ${bspWritesZeroCoverage} = "yes" ] ; then - while [ ${coverage} = "yes" -a ! -s ${toRun}.cov ] - do - echo Rerunning ${toRun} due to zero length coverage file - runtest ${toRun} ${testtype} ${limit} - done - fi - - # some BSPs produce trace oriented files which need to be converted - # to object coverage maps - if [ ${bspNeedsTraceConversion} = "yes" ] ; then - convertTraceToCoverageMap ${toRun} + # Some simulators fail to work correctly all the time. If this is one AND + # the run looks like it did not work right, then run again until it does + if [ ${bspRunsFailRandomly} = "yes" ] ; then + tries=1 + while [ `bspCheckRunWasOK` -eq 1 -a ${tries} -lt 3 ] + do + tries=`expr ${tries} + 1` + echo "Rerunning ${toRun} due to random run failure (try=${tries})" + runtest ${toRun} ${testtype} ${limit} + done + if [ ${tries} -eq 3 ] ; then + echo "WARNING ${toRun} does not look like it had any output" fi + fi + # some BSPs produce trace oriented files which need to be converted + # to object coverage maps + if [ ${bspNeedsTraceConversion} = "yes" ] ; then + convertTraceToCoverageMap ${toRun} fi diff --git a/sim-scripts/qemu-rtems.in b/sim-scripts/qemu-rtems.in index 56a115b..37724d1 100644 --- a/sim-scripts/qemu-rtems.in +++ b/sim-scripts/qemu-rtems.in @@ -11,6 +11,7 @@ if [ ! -r ${runBSP} ] ; then fi bspNeedsDos2Unix="yes" bspNeedsTraceConversion="yes" +bspRunsFailRandomly="yes" # Set the defaults based upon arguments given and do some error checking if [ X${QEMUDIR} == X ] ; then @@ -52,6 +53,7 @@ runARGS() cp ${1} ${hd0Dir}/test.exe if [ ${coverage} = yes ] ; then + rm -f trace ${1}.tra COVERAGE_ARG="-trace ${1}.tra" fi @@ -76,6 +78,21 @@ checkBSPFaults() return 0 } +bspCheckRunWasOK() +{ + tname=`get_tname $testname` + + logfile=${logdir}/${tname} + + # sometimes the log file indicates the test did not run + length=`grep -v "QEMU acceleration layer" ${logfile} | wc -c` + if [ ${length} -eq 0 ] ; then + echo 1 + else + echo 0 + fi +} + bspLimit() { case ${1} in diff --git a/sim-scripts/skyeye-support b/sim-scripts/skyeye-support index cf1b152..24c1cd1 100644 --- a/sim-scripts/skyeye-support +++ b/sim-scripts/skyeye-support @@ -10,7 +10,7 @@ bspNeedsDos2Unix="yes" bspGeneratesGDBCommands="yes" bspNeedsSttySane="no" # sometimes the .cov file has a zero length -bspWritesZeroCoverage="yes" +bspRunsFailRandomly="yes" if [ ${coverage} = "yes" ] ; then bspRunFatal="yes" @@ -27,6 +27,16 @@ gdbServerARGS() echo "-c ${bspTreeFile} -d" } +bspCheckRunWasOK() +{ + # sometimes the .cov file has a zero length + if [ ${coverage} = "yes" -a ! -s ${toRun}.cov ] ; then + echo 1 + else + echo 0 + fi +} + bspGenerateGDBCommands() { cat <<EOF diff --git a/sim-scripts/smdk2410.in b/sim-scripts/smdk2410.in index 4642341..005bfe4 100644 --- a/sim-scripts/smdk2410.in +++ b/sim-scripts/smdk2410.in @@ -33,7 +33,7 @@ bspLimit() } bspGeneratesDeviceTree="yes" -bspTreeFile=edb7312.conf +bspTreeFile=smdk2410.conf ### Generate the PSIM device tree based upon the type of application being run bspGenerateDeviceTree() |