Changeset f045b03 in rtems-testing


Ignore:
Timestamp:
Dec 1, 2011, 8:28:14 PM (7 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
3553b68
Parents:
6517cde
Message:

2011-12-01 Pawel Zagorski <pzagor@…>

  • do_coverage, rtems_config.in: Add GNU coverage support.
Location:
rtems-coverage
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    r6517cde rf045b03  
     12011-12-01      Pawel Zagorski <pzagor@agh.edu.pl>
     2
     3        * do_coverage, rtems_config.in: Add GNU coverage support.
     4
    152011-11-28      Aleksejs Popovs <me@popoffka.ru>
    26
  • rtems-coverage/do_coverage

    r6517cde rf045b03  
    4040        -r        -- run the tests (default=no)
    4141        -R        -- generate reports (default=no)
     42        -g        -- generate GCOV reports (default=no)
    4243        -f        -- publish the results to ftp site (default=no)
    4344        -t        -- save the results locally (default=no)
     
    8283# parse arguments for these
    8384verbose="no"
     85do_all="no"
    8486do_posix="yes"
    8587do_optimize_size="no"
     
    9193do_link_tests="yes"
    9294do_run_tests="no"
     95do_generate_gcov="no"
    9396do_reports="no"
    9497do_publish="no"
     
    99102BSP="not_set"
    100103
    101 while getopts vB:PSmAucbCLrRftO:dD OPT
     104while getopts vB:PSmAucbCLrgRftO:dD OPT
    102105do
    103106    case "$OPT" in
    104107        A)
     108          do_all="yes"
    105109          do_covoar="yes"
    106110          do_posix="yes"
     
    126130        L) do_link_tests=`toggle ${do_link_tests}` ;;
    127131        r) do_run_tests=`toggle ${do_run_tests}` ;;
     132        g) do_generate_gcov=`toggle ${do_generate_gcov}` ;;
    128133        R) do_reports=`toggle ${do_reports}` ;;
    129134        f) do_publish=`toggle ${do_publish}` ;;
     
    222227  echo "Core Configuration    " ${do_core}
    223228  echo "Developmental Code:   " ${do_developmental}
     229  echo "do_all:               " ${do_all}
    224230  echo "do_covoar             " ${do_covoar}
    225231  echo "do_rtems_update:      " ${do_rtems_update}
     
    229235  echo "do_link_tests:        " ${do_link_tests}
    230236  echo "do_run_tests:         " ${do_run_tests}
     237  echo "do_generate_gcov:     " ${do_generate_gcov}
    231238  echo "do_reports:           " ${do_reports}
    232239  echo "do_publish:           " ${do_publish}
     
    284291fi
    285292
    286 grep "^CFLAGS_OPTIMIZE_V.*=.*-O[s01234]" ${custom} >/dev/null
     293grep "^CFLAGS_OPTIMIZE_V.*=.*-O[s01234].*" ${custom} >/dev/null
    287294if [ $? -ne 0 ] ; then
    288295  echo "Unable to find CFLAGS_OPTIMIZE_V in ${custom}"
     
    387394      -e "s/@EXECUTABLE_EXTENSION@/exe/" \
    388395      -e "s/@COVERAGE_EXTENSION@/${RTEMSEXT}.${COVEXT}/" \
     396      -e "s,@GCNOS_LIST@,${rtems_gcnos_file}," \
    389397      -e "s/@PROJECT_NAME@/RTEMS ${RTEMS_VERSION}/" \
    390398      <${COVBASE}/rtems_config.in \
     
    419427
    420428  if [ -r ${RTEMSLIB} ] ; then
    421     cut -d' ' -f1 ${results_dir}/no_range_uncovered.txt | while read symbol
     429    while read symbol
    422430    do
    423431      line=`${TARGET}-nm --format=sysv \
     
    427435      size=`echo 16 i ${size} p | dc`
    428436      echo "${size}     ${symbol}       unknown"
    429     done | sort -n -r \
     437    done <${results_dir}/no_range_uncovered.txt | sort -n -r \
    430438         >${results_dir}/sizes_unreferenced.txt
    431439  fi
     
    603611if [ ${do_rtems_configure} = "yes" ] ; then
    604612  # Now let's patch the make/custom file
    605   sed -e "s/-O[0123s]/${c_opt}/" <${custom} >${custom}.tmp
     613  cat ${custom} |
     614  sed -e '/^CFLAGS_OPTIMIZE_V.*=.*-ftest-coverage -finline-functions -g/d' \
     615      -e "s/-O[0123s]/${c_opt}/" |
     616  if [ ${do_generate_gcov} = "yes" ] ; then
     617    sed -e \
     618      '/^CFLAGS_OPTIMIZE_V/a CFLAGS_OPTIMIZE_V += -ftest-coverage -finline-functions -g'
     619  else
     620    cat
     621  fi >${custom}.tmp
    606622  mv ${custom}.tmp ${custom}
    607623
     
    693709else
    694710  echo "Skipping copying tests..."
     711fi
     712
     713# If requested prepare data to create gcov reports
     714if [ ${do_generate_gcov} = "yes" ] ; then
     715  echo "Preparing data for gcov reports..."
     716
     717  cd ${BASEDIR}/b-${BSP}/
     718  check_status $? "cd b-${BSP}"
     719
     720  rtems_gcnos_file="${BASEDIR}/${BSP}-tests/rtems.gcnos"
     721  find `pwd`  -name \*.gcno >${rtems_gcnos_file}
     722
     723  check_status $? "Preparing data for gcov reports for for ${BSP}"
     724else
     725  rtems_gcnos_file="/dev/null"
     726  echo "Skipping creating gcov reports ..."
    695727fi
    696728
  • rtems-coverage/rtems_config.in

    r6517cde rf045b03  
    2323coverageExtension = @COVERAGE_EXTENSION@
    2424
     25# This is the path to file containing *.gcno list
     26gcnosFile = @GCNOS_LIST@
     27
    2528# This is the extension on the executable files.
    2629executableExtension = @EXECUTABLE_EXTENSION@
Note: See TracChangeset for help on using the changeset viewer.