Changeset 75ab20e in rtems-testing


Ignore:
Timestamp:
May 25, 2010, 5:50:59 PM (9 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
c6ae584
Parents:
09edbda
Message:

2010-05-25 Jennifer Averett <Jennifer.Averett@…>

  • ReportsBase?.cc, ReportsBase?.h, ReportsHtml?.cc, covoar.cc: Moved the summary report to the covoar common reports in the report class and out of the rtems specific items in the report index.
Location:
covoar
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • covoar/ChangeLog

    r09edbda r75ab20e  
     12010-05-25      Jennifer Averett <Jennifer.Averett@OARcorp.com>
     2
     3        * ReportsBase.cc, ReportsBase.h, ReportsHtml.cc, covoar.cc: Moved the
     4        summary report to the covoar common reports in the report class and
     5        out of the rtems specific items in the report index.
     6
    172010-05-24      Joel Sherrill <joel.sherrilL@OARcorp.com>
    28
  • covoar/ReportsBase.cc

    r09edbda r75ab20e  
    424424}
    425425
     426void  ReportsBase::WriteSummaryReport(
     427  const char* const fileName
     428)
     429{
     430    // Calculate coverage statistics and output results.
     431  uint32_t                                        a;
     432  uint32_t                                        endAddress;
     433  Coverage::DesiredSymbols::symbolSet_t::iterator itr;
     434  uint32_t                                        notExecuted = 0;
     435  double                                          percentage;
     436  Coverage::CoverageMapBase*                      theCoverageMap;
     437  uint32_t                                        totalBytes = 0;
     438  FILE*                                           report;
     439
     440  // Open the report file.
     441  report = OpenFile( fileName );
     442  if ( !report ) {
     443    return;
     444  }
     445
     446  // Look at each symbol.
     447  for (itr = SymbolsToAnalyze->set.begin();
     448       itr != SymbolsToAnalyze->set.end();
     449       itr++) {
     450
     451    // If the symbol's unified coverage map exists, scan through it
     452    // and count bytes.
     453    theCoverageMap = itr->second.unifiedCoverageMap;
     454    if (theCoverageMap) {
     455
     456      endAddress = itr->second.stats.sizeInBytes - 1;
     457
     458      for (a = 0; a <= endAddress; a++) {
     459        totalBytes++;
     460        if (!theCoverageMap->wasExecuted( a ))
     461          notExecuted++;
     462      }
     463    }
     464  }
     465
     466  percentage = (double) notExecuted;
     467  percentage /= (double) totalBytes;
     468  percentage *= 100.0;
     469
     470  fprintf( report, "Bytes Analyzed           : %d\n", totalBytes );
     471  fprintf( report, "Bytes Not Executed       : %d\n", notExecuted );
     472  fprintf( report, "Percentage Executed      : %5.4g\n", 100.0 - percentage  );
     473  fprintf( report, "Percentage Not Executed  : %5.4g\n", percentage  );
     474  fprintf(
     475    report,
     476    "Uncovered ranges found   : %d\n",
     477    SymbolsToAnalyze->getNumberUncoveredRanges()
     478  );
     479  if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
     480      (BranchInfoAvailable == false) ) {
     481    fprintf( report, "No branch information available\n" );
     482  } else {
     483    fprintf(
     484      report,
     485      "Total branches found     : %d\n",
     486      SymbolsToAnalyze->getNumberBranchesFound()
     487    );
     488    fprintf(
     489      report,
     490      "Uncovered branches found : %d\n",
     491      SymbolsToAnalyze->getNumberBranchesAlwaysTaken() +
     492       SymbolsToAnalyze->getNumberBranchesNeverTaken()
     493    );
     494    fprintf(
     495      report,
     496      "   %d branches always taken\n",
     497      SymbolsToAnalyze->getNumberBranchesAlwaysTaken()
     498    );
     499    fprintf(
     500      report,
     501      "   %d branches never taken\n",
     502      SymbolsToAnalyze->getNumberBranchesNeverTaken()
     503    );
     504  }
     505}
    426506
    427507void GenerateReports()
     
    493573    delete reports;
    494574  }
    495  
    496 }
    497 
    498 }
     575
     576  ReportsBase::WriteSummaryReport( "summary.txt" );
     577}
     578
     579}
  • covoar/ReportsBase.h

    r09edbda r75ab20e  
    9292
    9393    /*!
     94     *  This method produces a sumary report for the overall test run.
     95     */
     96    static void  WriteSummaryReport(
     97      const char* const fileName
     98    );
     99
     100    /*!
    94101     *  This method returns the unique extension for the Report
    95102     *  type.  If the extension is ".txt" files will be
     
    127134     *  @param[in] fileName identifies the report file name
    128135     */
    129      virtual FILE* OpenFile(
     136     static FILE* OpenFile(
    130137      const char* const fileName
    131138    );
     
    198205     *  @param[in] aFile identifies the report file name
    199206     */
    200     void CloseFile(
     207    static void CloseFile(
    201208      FILE*  aFile
    202209    );
  • covoar/ReportsHtml.cc

    r09edbda r75ab20e  
    8787    fprintf( aFile, "<ul>\n" );
    8888
     89    PRINT_TEXT_ITEM( "Summary",         "summary.txt" );
    8990    PRINT_ITEM( "Coverage Report",      "uncovered" );
    9091    PRINT_ITEM( "Branch Report",        "branch" );
  • covoar/covoar.cc

    r09edbda r75ab20e  
    462462  }
    463463
    464   // Calculate coverage statistics and output results.
    465   {
    466     uint32_t                                        a;
    467     uint32_t                                        endAddress;
    468     Coverage::DesiredSymbols::symbolSet_t::iterator itr;
    469     uint32_t                                        notExecuted = 0;
    470     double                                          percentage;
    471     Coverage::CoverageMapBase*                      theCoverageMap;
    472     uint32_t                                        totalBytes = 0;
    473 
    474     // Look at each symbol.
    475     for (itr = SymbolsToAnalyze->set.begin();
    476          itr != SymbolsToAnalyze->set.end();
    477          itr++) {
    478 
    479       // If the symbol's unified coverage map exists, scan through it
    480       // and count bytes.
    481       theCoverageMap = itr->second.unifiedCoverageMap;
    482       if (theCoverageMap) {
    483 
    484         endAddress = itr->second.stats.sizeInBytes - 1;
    485 
    486         for (a = 0; a <= endAddress; a++) {
    487           totalBytes++;
    488           if (!theCoverageMap->wasExecuted( a ))
    489             notExecuted++;
    490         }
    491       }
    492     }
    493 
    494     percentage = (double) notExecuted;
    495     percentage /= (double) totalBytes;
    496     percentage *= 100.0;
    497 
    498     printf( "Bytes Analyzed           : %d\n", totalBytes );
    499     printf( "Bytes Not Executed       : %d\n", notExecuted );
    500     printf( "Percentage Executed      : %5.4g\n", 100.0 - percentage  );
    501     printf( "Percentage Not Executed  : %5.4g\n", percentage  );
    502     printf(
    503       "Uncovered ranges found   : %d\n",
    504       SymbolsToAnalyze->getNumberUncoveredRanges()
    505     );
    506     if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
    507         (BranchInfoAvailable == false) ) {
    508       printf( "No branch information available\n" );
    509     } else {
    510       printf(
    511         "Total branches found     : %d\n",
    512         SymbolsToAnalyze->getNumberBranchesFound()
    513       );
    514       printf(
    515         "Uncovered branches found : %d\n",
    516         SymbolsToAnalyze->getNumberBranchesAlwaysTaken() +
    517          SymbolsToAnalyze->getNumberBranchesNeverTaken()
    518       );
    519       printf(
    520         "   %d branches always taken\n",
    521         SymbolsToAnalyze->getNumberBranchesAlwaysTaken()
    522       );
    523       printf(
    524         "   %d branches never taken\n",
    525         SymbolsToAnalyze->getNumberBranchesNeverTaken()
    526       );
    527     }
    528   }
    529 
    530464  return 0;
    531465}
Note: See TracChangeset for help on using the changeset viewer.