Changeset f381f26 in rtems-tools for tester


Ignore:
Timestamp:
Jan 19, 2015, 9:56:14 PM (5 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, e9f48e9face6c4dea62712d73b35412c0fe10332
Children:
69c955d
Parents:
3badbb0
Message:

Fix covoar so it builds for Windows.

Location:
tester/covoar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tester/covoar/DesiredSymbols.cc

    r3badbb0 rf381f26  
    22 *  @brief DesiredSymbols Implementation
    33 *
    4  *  This file contains the implementation of the functions 
     4 *  This file contains the implementation of the functions
    55 *  which provide the functionality of the DesiredSymbols.
    66 */
     
    6565
    6666      // Skip blank lines between symbols
    67       do { 
     67      do {
    6868        inputBuffer[0] = '\0';
    6969        inputBuffer2[0] = '\0';
     
    9393
    9494        // Add this to the set of symbols.
    95         else 
     95        else
    9696          set[ inputBuffer ] = *symInfo;
    9797      }
     
    163163
    164164        // If we are at the start of instruction increment
    165         // instruction type counters as needed. 
     165        // instruction type counters as needed.
    166166        if ( theCoverageMap->isStartOfInstruction( a ) ) {
    167167
     
    181181            sitr->second.stats.branchesExecuted++;
    182182          }
    183  
    184         }
    185  
     183
     184        }
     185
    186186        if (!theCoverageMap->wasExecuted( a )) {
    187187          stats.uncoveredBytes++;
    188188          sitr->second.stats.uncoveredBytes++;
    189         }       
     189        }
    190190        a++;
    191191
     
    252252      a = 0;
    253253      while (a <= endAddress) {
    254        
     254
    255255        // If an address was NOT executed, find consecutive unexecuted
    256256        // addresses and add them to the uncovered ranges.
     
    502502
    503503      // Use only the base filename without directory path.
     504#if WIN32
     505      #define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
     506#endif
    504507      realpath( inputBuffer, rpath );
    505508      base = basename( rpath );
     
    611614    if (set.find( symbolName ) == set.end()) {
    612615      #if 0
    613         fprintf( stderr, 
    614           "Warning: Unable to find symbol %s\n", 
    615           symbolName.c_str() 
     616        fprintf( stderr,
     617          "Warning: Unable to find symbol %s\n",
     618          symbolName.c_str()
    616619        );
    617620      #endif
     
    634637    uint32_t              sMapSize;
    635638    uint32_t              executionCount;
    636    
     639
    637640    // Ensure that the symbol is a desired symbol.
    638641    itr = set.find( symbolName );
  • tester/covoar/ReportsBase.cc

    r3badbb0 rf381f26  
    1515#include "ReportsHtml.h"
    1616
     17#if WIN32
     18#include <io.h>
     19#endif
     20
    1721namespace Coverage {
    1822
     
    3640
    3741  // Create the output directory if it does not already exist
     42#if WIN32
     43  sc = _mkdir( outputDirectory );
     44#else
    3845  sc = mkdir( outputDirectory,0755 );
     46#endif
    3947  if ( (sc == -1) && (errno != EEXIST) ) {
    4048    fprintf(stderr, "Unable to create output directory %s\n", outputDirectory);
     
    212220      if ( itr->isInstruction ) {
    213221        if (!theCoverageMap->wasExecuted( itr->address - bAddress )){
    214           annotation = "<== NOT EXECUTED";           
     222          annotation = "<== NOT EXECUTED";
    215223          state = A_NEVER_EXECUTED;
    216224          id = theRanges->getId( itr->address );
     
    231239      sprintf( textLine, "%-70s", itr->line.c_str() );
    232240      line = textLine + annotation;
    233      
    234       PutAnnotatedLine( aFile, state, line, id); 
     241
     242      PutAnnotatedLine( aFile, state, line, id);
    235243    }
    236244
     
    254262  bool                                            hasBranches = true;
    255263
    256   if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) || 
     264  if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
    257265      (BranchInfoAvailable == false) )
    258266     hasBranches = false;
     
    264272
    265273  // If no branches were found of branch coverage is not supported
    266   if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) || 
     274  if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
    267275      (BranchInfoAvailable == false) ) {
    268276
     
    360368void ReportsBase::WriteSizeReport(
    361369  const char* const fileName
    362 ) 
     370)
    363371{
    364372  Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
     
    476484    SymbolsToAnalyze->getNumberUncoveredRanges()
    477485  );
    478   if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) || 
     486  if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
    479487      (BranchInfoAvailable == false) ) {
    480488    fprintf( report, "No branch information available\n" );
     
    515523  time_t timestamp;
    516524
    517  
     525
    518526  timestamp = time(NULL); /* get current cal time */
    519527  reports = new ReportsText(timestamp);
  • tester/covoar/covoar.cc

    r3badbb0 rf381f26  
    33#include <fcntl.h>
    44#include <limits.h>
    5 #include <list>
    6 #include <netdb.h>
    75#include <signal.h>
    86#include <stdio.h>
     
    1210#include <sys/stat.h>
    1311#include <unistd.h>
     12
     13#include <list>
    1414
    1515#include "app_common.h"
     
    120120    if ( _t ) _val = _t; \
    121121  } while(0)
    122  
     122
    123123
    124124void check_configuration(void)
     
    161161
    162162  CoverageConfiguration = new Configuration::FileReader(Options);
    163  
     163
    164164  //
    165165  // Process command line options.
     
    439439  if (Verbose)
    440440    fprintf( stderr, "Generating Gcov reports...\n");
    441   gcnosFile = fopen ( gcnosFileName , "r" );   
     441  gcnosFile = fopen ( gcnosFileName , "r" );
    442442
    443443  if ( !gcnosFile ) {
Note: See TracChangeset for help on using the changeset viewer.