diff options
author | Alex White <alex.white@oarcorp.com> | 2021-02-25 10:47:58 -0600 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-03-30 13:15:58 -0500 |
commit | 04597495e59eba0bfa5c7935c30ee326fdc2c006 (patch) | |
tree | 57ab21428c3907017a43ad8d9704bb857d1a83b3 /tester/covoar/ReportsHtml.cc | |
parent | covoar/reports: Add new statistics to summary (diff) | |
download | rtems-tools-04597495e59eba0bfa5c7935c30ee326fdc2c006.tar.bz2 |
coverage/reports: Improve formatting and clarity
The coverage reports contain places where they display incorrect or
vague information particularly when some statistic is unavailable. This
has been fixed. The formatting and wording of various things has been
improved as well.
Diffstat (limited to 'tester/covoar/ReportsHtml.cc')
-rw-r--r-- | tester/covoar/ReportsHtml.cc | 159 |
1 files changed, 88 insertions, 71 deletions
diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc index ebc6ee0..cce0a4f 100644 --- a/tester/covoar/ReportsHtml.cc +++ b/tester/covoar/ReportsHtml.cc @@ -89,7 +89,7 @@ namespace Coverage { PRINT_ITEM( "Branch Report", "branch" ); PRINT_ITEM( "Annotated Assembly", "annotated" ); PRINT_ITEM( "Symbol Summary", "symbolSummary" ); - PRINT_ITEM( "Size Report", "sizes" ); + PRINT_ITEM( "Uncovered Range Size Report", "sizes" ); PRINT_TEXT_ITEM( "Explanations Not Found", "ExplanationsNotFound.txt" ); @@ -176,7 +176,7 @@ namespace Coverage { // Put header information into the file fprintf( aFile, - "<title>Branch Report</title\n" + "<title>Branch Report</title>\n" "<div class=\"heading-title\">" ); @@ -321,7 +321,7 @@ namespace Coverage { // Put header information into the file fprintf( aFile, - "<title>Size Report</title>\n" + "<title>Uncovered Range Size Report</title>\n" "<div class=\"heading-title\">" ); @@ -334,7 +334,7 @@ namespace Coverage { fprintf( aFile, - "Size Report</div>\n" + "Uncovered Range Size Report</div>\n" "<div class =\"datetime\">%s</div>\n" "<body>\n" "<table class=\"covoar table-autosort:0 table-autofilter table-stripeclass:covoar-tr-odd" @@ -490,7 +490,7 @@ namespace Coverage { FILE* report ) { - if ( BranchInfoAvailable ) + if (BranchInfoAvailable && SymbolsToAnalyze->getNumberBranchesFound() != 0) fprintf( report, "All branch paths taken.\n" ); else fprintf( report, "No branch information found.\n" ); @@ -861,90 +861,107 @@ namespace Coverage { symbol->first.c_str() ); - // Total Size in Bytes - fprintf( - report, - "<td class=\"covoar-td\" align=\"center\">%d</td>\n", - symbol->second.stats.sizeInBytes - ); - - // Total Size in Instructions - fprintf( - report, - "<td class=\"covoar-td\" align=\"center\">%d</td>\n", - symbol->second.stats.sizeInInstructions - ); - - // Total Uncovered Ranges - fprintf( - report, - "<td class=\"covoar-td\" align=\"center\">%d</td>\n", - symbol->second.stats.uncoveredRanges - ); - - // Uncovered Size in Bytes - fprintf( - report, - "<td class=\"covoar-td\" align=\"center\">%d</td>\n", - symbol->second.stats.uncoveredBytes - ); - - // Uncovered Size in Instructions - fprintf( - report, - "<td class=\"covoar-td\" align=\"center\">%d</td>\n", - symbol->second.stats.uncoveredInstructions - ); + if (symbol->second.stats.sizeInBytes == 0) { + // The symbol has never been seen. Write "unknown" for all columns. + fprintf( + report, + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + "<td class=\"covoar-td\" align=\"center\">unknown</td>\n" + ); + } else { + // Total Size in Bytes + fprintf( + report, + "<td class=\"covoar-td\" align=\"center\">%d</td>\n", + symbol->second.stats.sizeInBytes + ); - // Total number of branches - fprintf( - report, - "<td class=\"covoar-td\" align=\"center\">%d</td>\n", - symbol->second.stats.branchesNotExecuted + symbol->second.stats.branchesExecuted - ); + // Total Size in Instructions + fprintf( + report, + "<td class=\"covoar-td\" align=\"center\">%d</td>\n", + symbol->second.stats.sizeInInstructions + ); - // Total Always Taken - fprintf( - report, - "<td class=\"covoar-td\" align=\"center\">%d</td>\n", - symbol->second.stats.branchesAlwaysTaken - ); + // Total Uncovered Ranges + fprintf( + report, + "<td class=\"covoar-td\" align=\"center\">%d</td>\n", + symbol->second.stats.uncoveredRanges + ); - // Total Never Taken - fprintf( - report, - "<td class=\"covoar-td\" align=\"center\">%d</td>\n", - symbol->second.stats.branchesNeverTaken - ); + // Uncovered Size in Bytes + fprintf( + report, + "<td class=\"covoar-td\" align=\"center\">%d</td>\n", + symbol->second.stats.uncoveredBytes + ); - // % Uncovered Instructions - if ( symbol->second.stats.sizeInInstructions == 0 ) + // Uncovered Size in Instructions fprintf( report, - "<td class=\"covoar-td\" align=\"center\">100.00</td>\n" + "<td class=\"covoar-td\" align=\"center\">%d</td>\n", + symbol->second.stats.uncoveredInstructions ); - else + + // Total number of branches fprintf( report, - "<td class=\"covoar-td\" align=\"center\">%.2f</td>\n", - (symbol->second.stats.uncoveredInstructions*100.0)/ - symbol->second.stats.sizeInInstructions + "<td class=\"covoar-td\" align=\"center\">%d</td>\n", + symbol->second.stats.branchesNotExecuted + symbol->second.stats.branchesExecuted ); - // % Uncovered Bytes - if ( symbol->second.stats.sizeInBytes == 0 ) + // Total Always Taken fprintf( report, - "<td class=\"covoar-td\" align=\"center\">100.00</td>\n" + "<td class=\"covoar-td\" align=\"center\">%d</td>\n", + symbol->second.stats.branchesAlwaysTaken ); - else + + // Total Never Taken fprintf( report, - "<td class=\"covoar-td\" align=\"center\">%.2f</td>\n", - (symbol->second.stats.uncoveredBytes*100.0)/ - symbol->second.stats.sizeInBytes + "<td class=\"covoar-td\" align=\"center\">%d</td>\n", + symbol->second.stats.branchesNeverTaken ); + // % Uncovered Instructions + if ( symbol->second.stats.sizeInInstructions == 0 ) + fprintf( + report, + "<td class=\"covoar-td\" align=\"center\">100.00</td>\n" + ); + else + fprintf( + report, + "<td class=\"covoar-td\" align=\"center\">%.2f</td>\n", + (symbol->second.stats.uncoveredInstructions*100.0)/ + symbol->second.stats.sizeInInstructions + ); + + // % Uncovered Bytes + if ( symbol->second.stats.sizeInBytes == 0 ) + fprintf( + report, + "<td class=\"covoar-td\" align=\"center\">100.00</td>\n" + ); + else + fprintf( + report, + "<td class=\"covoar-td\" align=\"center\">%.2f</td>\n", + (symbol->second.stats.uncoveredBytes*100.0)/ + symbol->second.stats.sizeInBytes + ); + } + fprintf( report, "</tr>\n"); return true; } |