Changeset 0ef52d2 in rtems-testing


Ignore:
Timestamp:
May 11, 2010, 6:17:33 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
313e8a3
Parents:
2d24344
Message:

2010-05-11 Joel Sherrill <joel.sherrilL@…>

  • DesiredSymbols?.cc: Remove range1.tmp and ranges2.tmp.
  • ReportsBase?.cc, app_common.cc, covoar.cc, do_coverage: Generate files into user specified output directory.
Location:
rtems-coverage
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    r2d24344 r0ef52d2  
     12010-05-11      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        * DesiredSymbols.cc: Remove range1.tmp and ranges2.tmp.
     4        * ReportsBase.cc, app_common.cc, covoar.cc, do_coverage: Generate
     5        files into user specified output directory.
     6
    172010-05-10      Joel Sherrill <joel.sherrilL@OARcorp.com>
    28
  • rtems-coverage/DesiredSymbols.cc

    r2d24344 r0ef52d2  
    440440
    441441    fclose( tmpfile );
     442    unlink( "ranges1.tmp" );
     443    unlink( "ranges2.tmp" );
    442444  }
    443445
  • rtems-coverage/ReportsBase.cc

    r2d24344 r0ef52d2  
    55#include <stdio.h>
    66#include <string.h>
     7#include <errno.h>
     8#include <sys/stat.h>
     9#include <sys/types.h>
    710
    811#include "ReportsBase.h"
     
    1316#include "ObjdumpProcessor.h"
    1417
    15 
    1618#include "ReportsText.h"
    1719#include "ReportsHtml.h"
     
    3335)
    3436{
    35   FILE*  aFile;
     37  int          sc;
     38  FILE        *aFile;
     39  std::string  file;
     40
     41  // Create the output directory if it does not already exist
     42  sc = mkdir( outputDirectory,0755 );
     43  if ( (sc == -1) && (errno != EEXIST) ) {
     44    fprintf(stderr, "Unable to create output directory %s\n", outputDirectory);
     45    return NULL;
     46  }
     47
     48  file = outputDirectory;
     49  file += "/";
     50  file += fileName;
    3651
    3752  // Open the file.
    38   aFile = fopen( fileName, "w" );
     53  aFile = fopen( file.c_str(), "w" );
    3954  if ( !aFile ) {
    40     fprintf(
    41       stderr, "Unable to open %s\n", fileName
    42     );
     55    fprintf( stderr, "Unable to open %s\n", file.c_str() );
    4356  }
    4457  return aFile;
  • rtems-coverage/app_common.cc

    r2d24344 r0ef52d2  
    2323Coverage::Toolnames*        Tools            = NULL;
    2424bool                        Verbose          = false;
    25 
     25const char*                 outputDirectory = ".";
    2626
    2727bool FileIsNewer( const char *f1, const char *f2 ) {
     
    4646
    4747  do {
    48     if (! fgets( discardBuff, 99, file ) )
     48    if ( !fgets( discardBuff, 99, file ) )
    4949      return false;
    5050
  • rtems-coverage/covoar.cc

    r2d24344 r0ef52d2  
    4444const char*                          target = NULL;
    4545const char*                          format = NULL;
    46 const char*                          outputDirectory = ".";
    4746
    4847/*
     
    370369  // Write explanations that were not found.
    371370  if ( explanations ) {
    372     std::string str = explanations;
    373     str = str + ".NotFound";
     371    std::string notFound;
     372
     373    notFound = outputDirectory;
     374    notFound += "/";
     375    notFound += "ExplanationsNotFound.txt";
     376
    374377    if (Verbose)
    375       fprintf( stderr, "Writing Not Found Report (%s)\n", str.c_str() );
    376     AllExplanations->writeNotFound(str.c_str());
     378      fprintf( stderr, "Writing Not Found Report (%s)\n", notFound.c_str() );
     379    AllExplanations->writeNotFound( notFound.c_str() );
    377380  }
    378381
  • rtems-coverage/do_coverage

    r2d24344 r0ef52d2  
    204204  echo "BSP:                  " ${BSP}
    205205  echo "Target:               " ${TARGET}
     206  echo "Compiler version:     " `${TARGET}-gcc --version  | grep gcc`
     207  echo "do_optimize_size:     " ${do_optimize_size}
     208  echo "Optimization Level:   " ${c_opt}
     209  echo "POSIX Enabled:        " ${do_posix}
     210  echo "Developmental Code:   " ${do_developmental}
    206211  echo "do_all:               " ${do_all}
    207212  echo "do_covmerge           " ${do_covmerge}
    208   echo "do_posix:             " ${do_posix}
    209   echo "do_optimize_size:     " ${do_optimize_size}
    210213  echo "do_rtems_update:      " ${do_rtems_update}
    211214  echo "do_rtems_configure:   " ${do_rtems_configure}
     
    218221  echo "do_save_tarballs:     " ${do_save_tarballs}
    219222  echo "Clean Before:         " ${do_clean}
    220   echo "Executable Extension  " ${RTEMSEXT}
    221   echo "Coverage Extension    " ${COVEXT}
    222 
    223 }
     223  echo "Executable Extension: " ${RTEMSEXT}
     224  echo "Coverage Extension:   " ${COVEXT}
     225}
     226
     227if [ ${do_optimize_size} = yes ] ; then
     228 c_opt=-Os
     229else
     230 c_opt=-O2
     231fi
    224232
    225233if [ ${verbose} = "yes" ] ; then
     
    266274fi
    267275
    268 if [ ${do_optimize_size} = yes ] ; then
    269  c_opt=-Os
    270 else
    271  c_opt=-O2
    272 fi
    273 
    274276EXTENSION=${c_opt}
    275277if [ ${do_posix} = yes ] ; then
     
    295297generate_html()
    296298{
     299  summary=$1
    297300  echo "<TR>"
    298301    print_element ${day}
     
    301304    print_element ${do_posix}
    302305    print_element ${do_developmental}
    303     print_element `grep "Uncovered range" summary.txt | cut -d ':' -f2`
    304     print_element `grep "age Not Exec" summary.txt | cut -d ':' -f2`
    305     print_element `grep "age Exec" summary.txt | cut -d ':' -f2`
    306     print_element `grep "Bytes Not Exec" summary.txt | cut -d ':' -f2`
    307     print_element `grep "Bytes Analyzed" summary.txt | cut -d ':' -f2`
     306    print_element `grep "Uncovered range" ${summary} | cut -d ':' -f2`
     307    print_element `grep "age Not Exec" ${summary} | cut -d ':' -f2`
     308    print_element `grep "age Exec" ${summary} | cut -d ':' -f2`
     309    print_element `grep "Bytes Not Exec" ${summary} | cut -d ':' -f2`
     310    print_element `grep "Bytes Analyzed" ${summary} | cut -d ':' -f2`
    308311    print_element "<A HREF=\"${results_dir}\">untarred</A> " \
    309312                  "<A HREF=\"${results_dir}.tar.bz2\">tarball</A> "
     
    326329  check_status $? "cd ${BSP}-tests"
    327330
    328   rm -f summary.txt annotated.txt uncovered.txt branch.txt sizes.txt
    329 
    330   ( check_endof ; \
    331     echo "Optimization Level : " ${c_opt} ; \
    332     echo "POSIX Enabled      : " ${do_posix} ; \
    333     echo "Developmental Code : " ${do_developmental} ; \
    334   ) >summary.txt
    335331  rm -rf ${results_dir}
    336   # XXX temporary until output directory really supported
    337   mkdir ${results_dir}
    338   # XXX end of temporary
     332  mkdir  ${results_dir}
    339333  ${COVBASE}/covoar \
    340334    -O ${results_dir} \
     
    344338    -E ${COVBASE}/Explanations.txt \
    345339    -e exe -c ${RTEMSEXT}.${COVEXT} \
    346     *.exe >> summary.txt
     340    *.exe > ${results_dir}/summary.txt
    347341  check_status $? "covoar failed"
    348342
    349   (echo "====== Largest Range Sizes (Size and Count)======" ; \
    350     grep ^Size uncovered.txt | cut -d':' -f2 | sort -n | uniq -c | \
    351        tail -15 | sed -e 's/ *\([0-9]*\) *\([0-9]*\)/\2 \1/' | sort -n -r | \
    352        while read l; do printf "%6d %6d\n" $l; done ; \
    353     echo "=====================================" ) >>summary.txt
    354 
    355   generate_html >row.html
    356 
    357   cat summary.txt
     343  # This should be made obsolete by sortable tables.
     344  #(echo "====== Largest Range Sizes (Size and Count)======" ; \
     345  #  grep ^Size uncovered.txt | cut -d':' -f2 | sort -n | uniq -c | \
     346  #     tail -15 | sed -e 's/ *\([0-9]*\) *\([0-9]*\)/\2 \1/' | sort -n -r | \
     347  #     while read l; do printf "%6d %6d\n" $l; done ; \
     348  #  echo "=====================================" ) >>summary.txt
     349
     350  check_endof >${results_dir}/testsWithNoEndOfTest.txt
     351
     352  # Generate the configuration settings file
     353  (
     354    echo "#"
     355    echo "#  Settings for this coverage test run"
     356    echo "#"
     357    echo
     358    print_verbose
     359  ) >${results_dir}/configuration.txt
     360
     361  # XXX summary should be in output directory
     362  generate_html ${results_dir}/summary.txt >${results_dir}/row.html
     363
     364  cat ${results_dir}/summary.txt ${results_dir}/testsWithNoEndOfTest.txt
    358365
    359366  # Now create the archive of information
    360 
    361   # XXX temporary until output directory really supported
    362   cp *.txt *.html ${results_dir}
    363   # XXX end of temporary
    364 
    365   # XXX temporary until generated into output directory
    366   cp ${COVBASE}/Explanations.txt.NotFound ${results_dir}
    367   # XXX end of temporary
    368 
    369367  cp ${COVBASE}/covoar.css ${results_dir}
    370368  echo "Results saved in ${results_dir}.tar.bz2"
     
    610608  echo "Generating reports..."
    611609
    612   # Generate the configuration settings file
    613   ( \
    614     echo "#"
    615     echo "#  Settings for this coverage test run"
    616     echo "#"
    617     echo
    618     echo "Compiler version:   " `${TARGET}-gcc --version  | grep gcc`
    619     echo "Optimization flag   " ${c_opt}
    620     print_verbose
    621   ) > ${BASEDIR}/${BSP}-tests/configuration.txt
    622 
    623610  cd ${BASEDIR}/${BSP}-tests/
    624611  check_status $? "cd ${BSP}-tests"
Note: See TracChangeset for help on using the changeset viewer.