Changeset 29c59b5 in rtems-testing


Ignore:
Timestamp:
Mar 22, 2009, 4:06:44 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
a72f2588
Parents:
055296c
Message:

2009-03-22 Joel Sherrill <joel.sherrill@…>

  • gdb-sim-run.in: Output now left in log directory like "runtest" scripts. This makes it more useful for examining test output.
Location:
sim-scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sim-scripts/ChangeLog

    r055296c r29c59b5  
     12009-03-22  Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * gdb-sim-run.in: Output now left in log directory like "runtest"
     4        scripts.  This makes it more useful for examining test output.
     5
    162009-03-20      Joel Sherrill <joel.sherrill@OARcorp.com>
    27
  • sim-scripts/gdb-sim-run.in

    r055296c r29c59b5  
    2525        -v         -- verbose
    2626        -c         -- enabled coverage (default=no)
     27        -C         -- cat test output if not interactive (default=no)
    2728        -g         -- generate device tree and exit (default=no)
    2829        -i         -- interactive (default=no time limit)
    2930        -s         -- force System V IPC support (default=no)
    3031        -l limit   -- specify time limit (default is 'BSP dependent')
     32        -L dir     -- specify log directory (default is 'log')
    3133
    3234System V IPC and Coverage are not supported by all BSPs or simulators.
     
    5860#
    5961
     62doCatOutput="no"
    6063coverage="no"
    6164verbose="no"
     
    6467use_sysv_ipc="no"
    6568generate_tree_and_exit="no"
    66 
    67 while getopts vcgil:s OPT
     69logdir="log"
     70
     71while getopts "vcCgil:L:s" OPT
    6872do
    6973 case "$OPT" in
    7074   v) verbose="yes";;
    7175   c) coverage="yes";;
     76   C) doCatOutput="yes";;
    7277   g) generate_tree_and_exit="yes" ;;
    7378   i) interactive="yes";;
    7479   l) defaultLimit="$OPTARG";;
     80   L) loggir="$OPTARG";;
    7581   s) use_sysv_ipc="yes";;
    7682   *) fatal;;
     
    8187shift $shiftcount
    8288
     89args=$*
     90
    8391if [ ${interactive} = "yes" ] ; then
    8492  defaultLimit=0
    8593fi
    8694
    87 args=$*
     95if [ ! -d ${logdir} ] ; then
     96  mkdir $logdir || fatal "could not create log directory ($logdir)"
     97fi
    8898
    8999### Set BSP defaults.  If BSP does not have default, it will override
     
    104114done
    105115
    106 test ${verbose} = "yes" && echo Default program to run is ${defaultRun}
     116test ${verbose} = "yes" && echo Default program to run is ${defaultRUN}
    107117runBSP=${defaultRUN}
    108118
     
    178188catLog()
    179189{
     190  logfile=${1}
     191  if [ ${doCatOutput} = "no" ] ; then
     192    return
     193  fi
     194
    180195  if [ ${bspNeedsDos2Unix} = "yes" ] ; then
    181     dos2unix ${1}
    182   fi
    183 
    184   tr -d "\015" <${1}
     196    dos2unix ${logfile}
     197  fi
     198
     199  tr -d "\015" <${logfile}
    185200  echo
    186201}
     
    197212  fi
    198213
    199   echo run ${testname} for maximum ${max_run_time} seconds
    200   logfile=${testname}.tmp
     214  echo Running ${testname} for maximum ${max_run_time} seconds
     215  echo $testname | grep "exe$" >/dev/null
     216  if [ $? -eq 0 ] ; then
     217    ext=.exe
     218  else
     219    ext=.ralf
     220  fi
     221  tfile=`basename $testname`
     222  tname=`basename $tfile ${ext}`
     223
     224  logfile=${logdir}/${tname}
    201225
    202226  if [ ${bspSimTrustedToExit} = "yes" ] ; then
    203227    ${runBSP} `runARGS ${testname}` >${logfile} 2>&1
    204228    catLog ${logfile}
    205     rm -f ${logfile}
    206229    return
    207230  fi
     
    248271    # done normally
    249272    catLog ${logfile}
    250     echo "${testname} ran in ${milliseconds} milliseconds"
     273    test ${verbose} = "yes" && \
     274      echo "${testname} ran in ${milliseconds} milliseconds"
    251275    break
    252276  fi
    253277  done
    254278  kill -9 $pid >/dev/null 2>&1
    255 
    256   rm ${logfile}
    257279}
    258280
Note: See TracChangeset for help on using the changeset viewer.