Changeset c9f48e7 in rtems-testing


Ignore:
Timestamp:
May 11, 2010, 9:21:25 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
d29efc0
Parents:
b8bdf67
Message:

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

Location:
rtems-coverage
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    rb8bdf67 rc9f48e7  
     12010-05-11      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        * ReportsBase.cc, ReportsBase.h, ReportsHtml.cc, ReportsHtml.h,
     4        ReportsText.cc: Properly report on no branch information available.
     5        Distinguish between no branch information available and 100% branch
     6        coverage.
     7
    182010-05-11      Joel Sherrill <joel.sherrilL@OARcorp.com>
    29
  • rtems-coverage/ReportsBase.cc

    rb8bdf67 rc9f48e7  
    6666
    6767FILE* ReportsBase::OpenBranchFile(
    68   const char* const fileName
     68  const char* const fileName,
     69  bool              hasBranches
    6970)
    7071{
     
    102103
    103104void ReportsBase::CloseBranchFile(
    104   FILE*  aFile
     105  FILE*  aFile,
     106  bool   hasBranches
    105107)
    106108{
     
    218220  Coverage::CoverageRanges*                       theBranches;
    219221  unsigned int                                    count;
     222  bool                                            hasBranches = true;
     223
     224  if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
     225      (BranchInfoAvailable == false) )
     226     hasBranches = false;
    220227
    221228  // Open the branch report file
    222   report = OpenBranchFile( fileName );
    223 
     229  report = OpenBranchFile( fileName, hasBranches );
    224230  if (!report)
    225231    return;
     
    228234  if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
    229235      (BranchInfoAvailable == false) ) {
     236
    230237    PutNoBranchInfo(report);
     238
    231239    // If branches were found, ...
    232240  } else {
     
    252260  }
    253261
    254   CloseBranchFile( report );
     262  CloseBranchFile( report, hasBranches );
    255263}
    256264
  • rtems-coverage/ReportsBase.h

    rb8bdf67 rc9f48e7  
    119119     *
    120120     *  @param[in] fileName identifies the size report file name
     121     *  @param[in] hasBranches indicates if there are branches to report
    121122     */
    122123    virtual FILE* OpenBranchFile(
    123       const char* const fileName
     124      const char* const fileName,
     125      bool              hasBranches
    124126    );
    125127
     
    168170     *
    169171     *  @param[in] fileName identifies the size report file name
     172     *  @param[in] hasBranches indicates if there are branches to report
    170173     */
    171174    virtual void CloseBranchFile(
    172       FILE*  aFile
     175      FILE*  aFile,
     176      bool   hasBranches
    173177    );
    174178
  • rtems-coverage/ReportsHtml.cc

    rb8bdf67 rc9f48e7  
    5656
    5757FILE* ReportsHtml::OpenBranchFile(
    58   const char* const fileName
     58  const char* const fileName,
     59  bool              hasBranches
    5960)
    6061{
     
    6465  aFile = OpenFile(fileName);
    6566
    66   // Put header information into the file
    67   fprintf( aFile, "<table class=\"covoar-table\">\n");
    68   fprintf( aFile, "<tbody class=\"covoar-tbody\">\n");
    69   fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
    70   fprintf( aFile, "<th class=\"covoar-th\">Index</th>\n");
    71   fprintf( aFile, "<th class=\"covoar-th\">Symbol</th>\n");
    72   fprintf( aFile, "<th class=\"covoar-th\">Line</th>\n");
    73   fprintf( aFile, "<th class=\"covoar-th\">Size</th>\n");
    74   fprintf( aFile, "<th class=\"covoar-th\">Size</th>\n");
    75   fprintf( aFile, "<th class=\"covoar-th\">Reason</th>\n");
    76   fprintf( aFile, "<th class=\"covoar-th\">Classification</th>\n");
    77   fprintf( aFile, "<th class=\"covoar-th\">Explanation</th>\n");
    78   fprintf( aFile, "</tr>\n");
    79 
    80   fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
    81   fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
    82   fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
    83   fprintf( aFile, "<th class=\"covoar-th\">Bytes</th>\n");
    84   fprintf( aFile, "<th class=\"covoar-th\">Instructions</th>\n");
    85   fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
    86   fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
    87   fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
    88   fprintf( aFile, "</tr>\n");
     67  if ( hasBranches ) {
     68    // Put header information into the file
     69    fprintf( aFile, "<table class=\"covoar-table\">\n");
     70    fprintf( aFile, "<tbody class=\"covoar-tbody\">\n");
     71    fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
     72    fprintf( aFile, "<th class=\"covoar-th\">Index</th>\n");
     73    fprintf( aFile, "<th class=\"covoar-th\">Symbol</th>\n");
     74    fprintf( aFile, "<th class=\"covoar-th\">Line</th>\n");
     75    fprintf( aFile, "<th class=\"covoar-th\">Size</th>\n");
     76    fprintf( aFile, "<th class=\"covoar-th\">Size</th>\n");
     77    fprintf( aFile, "<th class=\"covoar-th\">Reason</th>\n");
     78    fprintf( aFile, "<th class=\"covoar-th\">Classification</th>\n");
     79    fprintf( aFile, "<th class=\"covoar-th\">Explanation</th>\n");
     80    fprintf( aFile, "</tr>\n");
     81
     82    fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
     83    fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
     84    fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
     85    fprintf( aFile, "<th class=\"covoar-th\">Bytes</th>\n");
     86    fprintf( aFile, "<th class=\"covoar-th\">Instructions</th>\n");
     87    fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
     88    fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
     89    fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
     90    fprintf( aFile, "</tr>\n");
     91  }
    8992 
    9093  return aFile;
     
    99102  // Open the file
    100103  aFile = OpenFile(fileName);
    101 
    102104
    103105  // Put header information into the file
     
    126128  aFile = OpenFile(fileName);
    127129
    128 
    129130  // Put header information into the file
    130131  fprintf( aFile, "<table class=\"covoar-table\">\n");
     
    135136  fprintf( aFile, "<th class=\"covoar-th\">File</th>\n");
    136137  fprintf( aFile, "</tr>\n");
    137 
    138 
    139138
    140139  return aFile;
     
    210209)
    211210{
    212   fprintf( report, "No branch information found\n" );
     211  if ( BranchInfoAvailable )
     212    fprintf( report, "All branch paths taken.\n" );
     213  else
     214    fprintf( report, "No branch information found.\n" );
    213215  return true;
    214216}
    215 
    216217
    217218bool ReportsHtml::PutBranchEntry(
     
    524525
    525526void ReportsHtml::CloseBranchFile(
    526   FILE*  aFile
    527 )
    528 {
    529   fprintf( aFile, "</tbody>\n" );
    530   fprintf( aFile, "</table>\n" );
     527  FILE*  aFile,
     528  bool   hasBranches
     529)
     530{
     531  if ( hasBranches ) {
     532    fprintf( aFile, "</tbody>\n" );
     533    fprintf( aFile, "</table>\n" );
     534  }
    531535  fprintf( aFile, "</pre>\n" );
    532536  fprintf( aFile, "</body>\n");
  • rtems-coverage/ReportsHtml.h

    rb8bdf67 rc9f48e7  
    6060
    6161    virtual FILE* OpenBranchFile(
    62       const char* const fileName
     62      const char* const fileName,
     63      bool              hasBranches
    6364    );
    6465
     
    7677
    7778    virtual void CloseBranchFile(
    78       FILE*  aFile
     79      FILE*  aFile,
     80      bool   hasBranches
    7981    );
    8082
  • rtems-coverage/ReportsText.cc

    rb8bdf67 rc9f48e7  
    3636)
    3737{
    38   fprintf( report, "No branch information found\n" );
     38  if ( BranchInfoAvailable )
     39    fprintf( report, "All branch paths taken.\n" );
     40  else
     41    fprintf( report, "No branch information found.\n" );
    3942  return true;
    4043}
Note: See TracChangeset for help on using the changeset viewer.