Changeset 0d0d944 in rtems-testing


Ignore:
Timestamp:
Mar 18, 2009, 6:04:06 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
16a963b
Parents:
3e19955
Message:

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

Location:
rtems-coverage
Files:
7 added
8 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    r3e19955 r0d0d944  
     12009-03-18      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * CoverageReaderTSIM.cc, CoverageReaderTSIM.h, Makefile,
     4        VERSIONS-COVERAGE, covmerge.cc, do_coverage, gen_report: First
     5        attempt at adding Skyeye code coverage support.
     6        * CoverageFactory.cc, CoverageFactory.h, CoverageReaderSkyeye.cc,
     7        CoverageReaderSkyeye.h, CoverageWriterSkyeye.cc,
     8        CoverageWriterSkyeye.h, skyeye_header.h: New files.
     9
    1102009-03-12      Joel Sherrill <joel.sherrill@OARcorp.com>
    211
  • rtems-coverage/CoverageReaderTSIM.cc

    r3e19955 r0d0d944  
    4343    coverageFile = fopen( file, "r" );
    4444    if ( !coverageFile ) {
    45       fprintf( stderr, "CoverageReaderTSIM::ProcessFile - unable to open %s\n", file );
     45      fprintf(
     46        stderr, "CoverageReaderTSIM::ProcessFile - unable to open %s\n", file );
    4647      exit(-1);
    4748    }
     
    5657        status = fscanf( coverageFile, "%d", &cover );
    5758        if ( status == EOF || status == 0 ) {
    58           fprintf( stderr, "Error in %s at address 0x%08x\n", file, baseAddress );
     59          fprintf(
     60            stderr, "Error in %s at address 0x%08x\n", file, baseAddress );
    5961          exit( -1 );
    6062        }
  • rtems-coverage/CoverageReaderTSIM.h

    r3e19955 r0d0d944  
    1818  /*! @class CoverageReaderTSIM
    1919   *
    20    *  This class implements the class which reads a coverage map file produced by TSIM.
    21    *  Since the SPARC has 32-bit instructions, TSIM produces a file with an integer for
    22    *  each 32-bit word.  The integer will have the least significant bit if the address
     20   *  This class implements the class which reads a coverage map file
     21   *  produced by TSIM.  Since the SPARC has 32-bit instructions,
     22   *  TSIM produces a file with an integer for each 32-bit word.  The
     23   *  integer will have the least significant bit if the address
    2324   *  was executed.
    2425
  • rtems-coverage/Makefile

    r3e19955 r0d0d944  
    55COVMERGE_OBJS= covmerge.o CoverageMap.o CoverageMapBase.o \
    66  CoverageRanges.o \
    7   CoverageReaderBase.o CoverageReaderTSIM.o \
    8   CoverageWriterBase.o CoverageWriterTSIM.o \
     7  CoverageFactory.o \
     8  CoverageReaderBase.o CoverageReaderSkyeye.o CoverageReaderTSIM.o \
     9  CoverageWriterBase.o CoverageWriterSkyeye.o CoverageWriterTSIM.o \
    910  Explanations.o ObjdumpProcessor.o Toolnames.o
    1011
     
    1415        $(CXX) -o $(@) $(COVMERGE_OBJS)
    1516
    16 covmerge.o: covmerge.cc CoverageMap.h CoverageReaderBase.h \
    17   CoverageReaderNops.h CoverageReaderTSIM.h CoverageWriterBase.h \
    18   CoverageWriterTSIM.h
     17covmerge.o: covmerge.cc CoverageMap.h CoverageFactory.h
    1918
     19CoverageFactory.o: CoverageFactory.cc CoverageFactory.h CoverageReaderBase.h \
     20  CoverageReaderNops.h CoverageReaderSkyeye.h CoverageReaderTSIM.h  \
     21  CoverageWriterBase.h CoverageWriterSkyeye.h CoverageWriterTSIM.h
    2022CoverageMap.o: CoverageMap.cc CoverageMap.h
    2123CoverageRanges.o: CoverageRanges.cc CoverageRanges.h
    2224CoverageReaderBase.o: CoverageReaderBase.cc CoverageReaderBase.h
    23 CoverageReaderTSIM.o: CoverageReaderTSIM.cc CoverageReaderTSIM.h
     25CoverageReaderSkyeye.o: CoverageReaderSkyeye.cc CoverageReaderSkyeye.h \
     26  skyeye_header.h
     27CoverageReaderTSIM.o: CoverageReaderTSIM.cc CoverageReaderTSIM.h \
     28  skyeye_header.h
    2429CoverageWriterBase.o: CoverageWriterBase.cc CoverageWriterBase.h
     30CoverageWriterSkyeye.o: CoverageWriterSkyeye.cc CoverageWriterSkyeye.h
    2531CoverageWriterTSIM.o: CoverageWriterTSIM.cc CoverageWriterTSIM.h
    2632Explanations.o: Explanations.cc Explanations.h
  • rtems-coverage/VERSIONS-COVERAGE

    r3e19955 r0d0d944  
    44RTEMS_VERSION=4.10
    55
    6 CPU=sparc
    7 BSP=erc32
    8 RUNNER=runerc32
     6# CPU=sparc
     7# BSP=erc32
     8# RUNNER=runerc32
     9# COVERAGE_FORMAT=TSIM
     10CPU=arm
     11BSP=edb7312
     12RUNNER=edb7312
     13COVERAGE_FORMAT=Skyeye
    914
    1015RTEMSDIR=${BASEDIR}/rtems
  • rtems-coverage/covmerge.cc

    r3e19955 r0d0d944  
    1717
    1818#include "CoverageMap.h"
    19 #include "CoverageReaderTSIM.h"
    20 #include "CoverageWriterTSIM.h"
     19#include "CoverageFactory.h"
    2120#include "ObjdumpProcessor.h"
    2221#include "app_common.h"
     
    2827 */
    2928int verbose = 0;
    30 int useTSIMFormat = 1;
     29Coverage::CoverageFormats_t coverageFormat;
    3130char *mergedCoverageFile = NULL;
    3231char *coverageReportFile = NULL;
     
    9594    "  -l low address   - low address of range to merge\n"
    9695    "  -l high address  - high address of range to merge\n"
    97     "  -t               - input files are in tsim format\n"
     96    "  -f format        - coverage files are in <format> (TSIM or Skyeye)\n"
    9897    "  -m FILE          - optional merged coverage file to write\n"
    9998    "  -r REPORT        - optional coverage report to write\n"
     
    275274  int opt;
    276275  int i;
     276  char *format = NULL;
    277277
    278278  progname = argv[0];
    279279
    280   while ((opt = getopt(argc, argv, "a:e:E:h:l:tm:r:T:v")) != -1) {
     280  while ((opt = getopt(argc, argv, "a:e:E:f:h:l:m:r:T:v")) != -1) {
    281281    switch (opt) {
    282282      case 'T': target             = optarg;  break;
     
    285285      case 'm': mergedCoverageFile = optarg;  break;
    286286      case 'r': coverageReportFile = optarg;  break;
    287       case 't': useTSIMFormat      = 1;       break;
    288287      case 'v': verbose            = 1;       break;
     288      case 'f':
     289        coverageFormat = Coverage::CoverageFormatToEnum(optarg);
     290        format = optarg;
     291        break;
    289292      case 'l':
    290293        if ( ! stringToUint32( optarg, 16, &lowAddress ) ) {
     
    308311  if ( verbose ) {
    309312    fprintf( stderr, "verbose         : %d\n", verbose );
    310     fprintf( stderr, "use TSIM Format : %d\n", useTSIMFormat );
     313    fprintf( stderr, "Coverage Format : %s\n", format );
    311314    fprintf( stderr, "low address     : 0x%08x\n", lowAddress );
    312315    fprintf( stderr, "high address    : 0x%08x\n", highAddress );
     
    330333
    331334  /*
     335   *  Validate format
     336   */
     337  if ( !format ) {
     338    fprintf( stderr, "coverage format report must be given.\n\n" );
     339    usage();
     340    exit(-1);
     341  }
     342
     343  /*
    332344   *  Create a ranges set
    333345   */
     
    371383   * Create input
    372384   */
    373   if ( useTSIMFormat ) {
    374     CoverageReader = new Coverage::CoverageReaderTSIM();
    375   } else {
    376     fprintf( stderr, "No input format specified.\n\n" );
    377     exit(-1);
    378   }
     385 
     386  CoverageReader = Coverage::CreateCoverageReader(coverageFormat);
    379387
    380388  if ( !CoverageReader ) {
     
    393401   * NOTE: We only support one format currently.
    394402   */
    395   CoverageWriter = new Coverage::CoverageWriterTSIM();
     403  CoverageWriter = Coverage::CreateCoverageWriter(coverageFormat);
    396404
    397405  if ( !CoverageWriter ) {
  • rtems-coverage/do_coverage

    r3e19955 r0d0d944  
    250250  check_status $? "cd ${BSP}-tests"
    251251
    252   time ${RUNNER} -C
     252  time ${RUNNER} -c *.exe
    253253else
    254254  echo "Skipping Running tests..."
  • rtems-coverage/gen_report

    r3e19955 r0d0d944  
    6161rm -f merged.cov report
    6262${COVBASE}/covmerge -l 0x${tlow} -h 0x${thigh} -r report \
    63  -E ${COVBASE}/Explanations.txt \
     63 -E ${COVBASE}/Explanations.txt -f ${COVERAGE_FORMAT} \
    6464 -T ${TARGET} -e hello.exe -m merged.cov *.cov
    6565
Note: See TracChangeset for help on using the changeset viewer.