Changeset 01f2cfc in rtems-testing


Ignore:
Timestamp:
May 12, 2010, 4:14:16 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
d509ff0
Parents:
d0f1005
Message:

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

Location:
rtems-coverage
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    rd0f1005 r01f2cfc  
     12010-05-12      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        * ReportsBase.cc, ReportsBase.h, ReportsHtml.cc, ReportsHtml.h,
     4        ReportsText.cc, ReportsText.h: Add initial Symbol Summary report as
     5        copy of Size report.
     6
    172010-05-12      Glenn Humphrey
    28
  • rtems-coverage/ReportsBase.cc

    rd0f1005 r01f2cfc  
    3030}
    3131
    32 
    3332FILE* ReportsBase::OpenFile(
    3433  const char* const fileName
     
    8786}
    8887
     88FILE* ReportsBase::OpenSymbolSummaryFile(
     89  const char* const fileName
     90)
     91{
     92  return OpenFile(fileName);
     93}
    8994
    9095void ReportsBase::CloseFile(
     
    124129}
    125130
     131void  ReportsBase::CloseSymbolSummaryFile(
     132  FILE*  aFile
     133)
     134{
     135  CloseFile( aFile );
     136}
    126137
    127138/*
     
    351362}
    352363
     364void ReportsBase::WriteSymbolSummaryReport(
     365  const char* const fileName
     366)
     367{
     368  Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
     369  FILE*                                           report;
     370  Coverage::CoverageRanges::ranges_t::iterator    ritr;
     371  Coverage::CoverageRanges*                       theRanges;
     372  unsigned int                                    count;
     373
     374  // Open the report file.
     375  report = OpenSymbolSummaryFile( fileName );
     376  if ( !report ) {
     377    return;
     378  }
     379
     380  // Process uncovered ranges for each symbol.
     381  count = 0;
     382  for (ditr = SymbolsToAnalyze->set.begin();
     383       ditr != SymbolsToAnalyze->set.end();
     384       ditr++) {
     385
     386    theRanges = ditr->second.uncoveredRanges;
     387
     388    if (theRanges && !theRanges->set.empty()) {
     389
     390      for (ritr =  theRanges->set.begin() ;
     391           ritr != theRanges->set.end() ;
     392           ritr++ ) {
     393        PutSymbolSummaryLine( report, count, ditr, ritr );
     394        count++;
     395      }
     396    }
     397  }
     398
     399  CloseSymbolSummaryFile( report );
     400}
     401
    353402void GenerateReports()
    354403{
     
    380429    reports->WriteSizeReport(reportName.c_str() );
    381430
     431    reportName = "symbolSummary" + reports->ReportExtension();
     432    reports->WriteSizeReport(reportName.c_str() );
    382433  }
    383434
  • rtems-coverage/ReportsBase.h

    rd0f1005 r01f2cfc  
    6161     *  range of bytes.
    6262     *
    63      *  @param[in] fileName identifies the size report file name
     63     *  @param[in] fileName identifies the report file name
    6464     */
    6565    void WriteSizeReport(
     66      const char* const fileName
     67    );
     68
     69    /*!
     70     *  This method produces a summary report that lists information on
     71     *  each symbol which did not achieve 100% coverage
     72     *
     73     *  @param[in] fileName identifies the report file name
     74     */
     75    void WriteSymbolSummaryReport(
    6676      const char* const fileName
    6777    );
     
    7282     *  named "annotated.txt", "branch.txt" ......
    7383     *
    74      *  @param[in] fileName identifies the size report file name
     84     *  @param[in] fileName identifies the report file name
    7585     */
    7686    std::string ReportExtension() { return reportExtension_m; }
     
    95105
    96106    /*!
    97      *  This method Opens a report file and verifies that it opended
     107     *  This method Opens a report file and verifies that it opened
    98108     *  correctly.  Upon failure NULL is returned.
    99109     *
    100      *  @param[in] fileName identifies the size report file name
     110     *  @param[in] fileName identifies the report file name
    101111     */
    102112     virtual FILE* OpenFile(
     
    105115
    106116    /*!
    107      *  This method d Opens a report file and verifies that it opended.
    108      *  Then appedns any necessary header information onto the file.
    109      *
    110      *  @param[in] fileName identifies the size report file name
     117     *  This method opens a report file and verifies that it opened.
     118     *  Then appedns any necessary header information onto the file.
     119     *
     120     *  @param[in] fileName identifies the report file name
    111121     */
    112122    virtual FILE* OpenAnnotatedFile(
     
    115125
    116126    /*!
    117      *  This method d Opens a report file and verifies that it opended.
    118      *  Then appedns any necessary header information onto the file.
    119      *
    120      *  @param[in] fileName identifies the size report file name
     127     *  This method opens a report file and verifies that it opened.
     128     *  Then appedns any necessary header information onto the file.
     129     *
     130     *  @param[in] fileName identifies the report file name
    121131     *  @param[in] hasBranches indicates if there are branches to report
    122132     */
     
    127137
    128138    /*!
    129      *  This method d Opens a report file and verifies that it opended.
    130      *  Then appedns any necessary header information onto the file.
    131      *
    132      *  @param[in] fileName identifies the size report file name
     139     *  This method opens a report file and verifies that it opened.
     140     *  Then appedns any necessary header information onto the file.
     141     *
     142     *  @param[in] fileName identifies the report file name
    133143     */
    134144    virtual FILE* OpenCoverageFile(
     
    137147
    138148    /*!
    139      *  This method d Opens a report file and verifies that it opended.
    140      *  Then appedns any necessary header information onto the file.
    141      *
    142      *  @param[in] fileName identifies the size report file name
     149     *  This method opens a report file and verifies that it opened.
     150     *  Then appedns any necessary header information onto the file.
     151     *
     152     *  @param[in] fileName identifies the report file name
    143153     */
    144154    virtual FILE* OpenSizeFile(
     
    147157
    148158    /*!
     159     *  This method opens a report file and verifies that it opened.
     160     *  Then appedns any necessary header information onto the file.
     161     *
     162     *  @param[in] fileName identifies the report file name
     163     */
     164    virtual FILE* OpenSymbolSummaryFile(
     165      const char* const fileName
     166    );
     167
     168    /*!
    149169     *  This method Closes a report file.
    150170     *
    151      *  @param[in] fileName identifies the size report file name
     171     *  @param[in] fileName identifies the report file name
    152172     */
    153173    void CloseFile(
     
    159179     *  the report then closes the file.
    160180     *
    161      *  @param[in] fileName identifies the size report file name
     181     *  @param[in] fileName identifies the report file name
    162182     */
    163183    virtual void CloseAnnotatedFile(
     
    169189     *  the report then closes the file.
    170190     *
    171      *  @param[in] fileName identifies the size report file name
     191     *  @param[in] fileName identifies the report file name
    172192     *  @param[in] hasBranches indicates if there are branches to report
    173193     */
     
    181201     *  the report then closes the file.
    182202     *
    183      *  @param[in] fileName identifies the size report file name
     203     *  @param[in] fileName identifies the report file name
    184204     */
    185205    virtual void CloseCoverageFile(
     
    191211     *  the report then closes the file.
    192212     *
    193      *  @param[in] fileName identifies the size report file name
     213     *  @param[in] fileName identifies the report file name
    194214     */
    195215    virtual void CloseSizeFile(
     
    201221     *  the report then closes the file.
    202222     *
    203      *  @param[in] fileName identifies the size report file name
     223     *  @param[in] fileName identifies the report file name
     224     */
     225    virtual void CloseSymbolSummaryFile(
     226      FILE*  aFile
     227    );
     228
     229    /*!
     230     *  This method puts any necessary footer information into
     231     *  the report then closes the file.
     232     *
     233     *  @param[in] fileName identifies the report file name
    204234     */
    205235    virtual void PutAnnotatedLine(
     
    214244     *  the report then closes the file.
    215245     *
    216      *  @param[in] fileName identifies the size report file name
     246     *  @param[in] fileName identifies the report file name
    217247     */
    218248    virtual bool PutNoBranchInfo(
     
    223253     *  This method puts a branch entry into the branch report.
    224254     *
    225      *  @param[in] fileName identifies the size report file name
     255     *  @param[in] fileName identifies the report file name
    226256     */
    227257    virtual bool PutBranchEntry(
     
    236266     *  a symbol in the coverage report.
    237267     *
    238      *  @param[in] fileName identifies the size report file name
     268     *  @param[in] fileName identifies the report file name
    239269     */
    240270    virtual void putCoverageNoRange(
     
    247277     *  This method puts a line in the coverage report.
    248278     *
    249      *  @param[in] fileName identifies the size report file name
     279     *  @param[in] fileName identifies the report file name
    250280     */
    251281    virtual bool PutCoverageLine(
     
    267297      Coverage::CoverageRanges::ranges_t::iterator    range
    268298    )=0;
     299
     300    /*!
     301     *  This method method puts a line into the symbol summary report.
     302     *
     303     *  @param[in] fileName identifies the report file name
     304     */
     305    virtual bool PutSymbolSummaryLine(
     306      FILE*                                           report,
     307      unsigned int                                    number,
     308      Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
     309      Coverage::CoverageRanges::ranges_t::iterator    range
     310    )=0;
    269311};
    270312
  • rtems-coverage/ReportsHtml.cc

    rd0f1005 r01f2cfc  
    120120
    121121  FILE*  ReportsHtml::OpenSizeFile(
     122    const char* const fileName
     123  )
     124  {
     125    FILE *aFile;
     126
     127    // Open the file
     128    aFile = OpenFile(fileName);
     129
     130    // Put header information into the file
     131    fprintf(
     132      aFile,
     133      "<table class=\"covoar-table\">\n"
     134      "<tbody class=\"covoar-tbody\">\n"
     135      "<tr class=\"covoar-tr covoar-tr-first\">\n"
     136      "<th class=\"covoar-th\">Size</th>\n"
     137      "<th class=\"covoar-th\">Symbol</th>\n"
     138      "<th class=\"covoar-th\">File</th>\n"
     139      "</tr>\n"
     140    );
     141    return aFile;
     142  }
     143
     144  FILE*  ReportsHtml::OpenSymbolSummaryFile(
    122145    const char* const fileName
    123146  )
     
    522545  }
    523546
     547  bool  ReportsHtml::PutSymbolSummaryLine(
     548    FILE*                                           report,
     549    unsigned int                                    count,
     550    Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
     551    Coverage::CoverageRanges::ranges_t::iterator    range
     552  )
     553  {
     554    // Mark the background color different for odd and even lines.
     555    fprintf( report, "</tr>\n");
     556    if ( ( count%2 ) == 0 )
     557      fprintf( report, "<tr class=\"covoar-tr covoar-tr-even\">\n");
     558    else
     559      fprintf( report, "<tr class=\"covoar-tr covoar-tr-odd\">\n");
     560
     561    // size
     562    fprintf(
     563      report,
     564      "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
     565      range->highAddress - range->lowAddress + 1
     566    );
     567
     568    // symbol
     569    fprintf(
     570      report,
     571      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
     572      symbol->first.c_str()
     573    );
     574
     575    // file
     576    fprintf(
     577      report,
     578      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
     579      range->lowSourceLine.c_str()
     580    );
     581
     582    return true;
     583  }
     584
    524585  void ReportsHtml::CloseAnnotatedFile(
    525586    FILE*  aFile
     
    581642    fprintf( aFile, "</table>\n" );
    582643    fprintf( aFile, "</pre>\n" );
     644    fprintf( aFile,"</body>\n");
     645    fprintf( aFile,"</html>");
     646
     647    CloseFile( aFile );
     648  }
     649
     650  void ReportsHtml::CloseSymbolSummaryFile(
     651    FILE*  aFile
     652  )
     653  {
     654    fprintf( aFile, "</tbody>\n" );
     655    fprintf( aFile, "</table>\n" );
    583656    fprintf( aFile, "</pre>\n" );
    584657    fprintf( aFile,"</body>\n");
  • rtems-coverage/ReportsHtml.h

    rd0f1005 r01f2cfc  
    7373    );
    7474
     75    virtual FILE* OpenSymbolSummaryFile(
     76      const char* const fileName
     77    );
     78
    7579    virtual void CloseAnnotatedFile(
    7680      FILE*  aFile
     
    8791
    8892    virtual void CloseSizeFile(
     93      FILE*  aFile
     94    );
     95
     96    virtual void CloseSymbolSummaryFile(
    8997      FILE*  aFile
    9098    );
     
    128136    );
    129137
     138    virtual bool PutSymbolSummaryLine(
     139      FILE*                                           report,
     140      unsigned int                                    number,
     141      Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
     142      Coverage::CoverageRanges::ranges_t::iterator    range
     143    );
     144
    130145    virtual FILE* OpenFile(
    131146      const char* const fileName
  • rtems-coverage/ReportsText.cc

    rd0f1005 r01f2cfc  
    206206}
    207207
    208 
    209 
    210 }
     208bool  ReportsText::PutSymbolSummaryLine(
     209  FILE*                                      report,
     210  unsigned int                                     number,
     211  Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
     212  Coverage::CoverageRanges::ranges_t::iterator    range
     213)
     214{
     215  fprintf(
     216    report,
     217    "%d\t%s\t%s\n",
     218    range->highAddress - range->lowAddress + 1,
     219    symbol->first.c_str(),
     220    range->lowSourceLine.c_str()
     221  );
     222  return true;
     223}
     224
     225}
  • rtems-coverage/ReportsText.h

    rd0f1005 r01f2cfc  
    9595    );
    9696
    97 
     97    virtual bool PutSymbolSummaryLine(
     98      FILE*                                           report,
     99      unsigned int                                    number,
     100      Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
     101      Coverage::CoverageRanges::ranges_t::iterator    range
     102    );
    98103
    99104};
Note: See TracChangeset for help on using the changeset viewer.