summaryrefslogtreecommitdiffstats
path: root/tester/covoar
diff options
context:
space:
mode:
authorAlex White <alex.white@oarcorp.com>2021-03-01 10:58:11 -0600
committerJoel Sherrill <joel@rtems.org>2021-03-30 13:15:58 -0500
commit0e6c7ec2536be18fce380ce83f996868d9021703 (patch)
tree9bdf4f5dbbeb84d539e6c3eb3abd8bdf2f14a90d /tester/covoar
parentcovoar: Fix overflow of high PC address (diff)
downloadrtems-tools-0e6c7ec2536be18fce380ce83f996868d9021703.tar.bz2
covoar/Reports: Fix empty branch report
This makes the branch report more consistent with the other reports when there is no branch information found.
Diffstat (limited to 'tester/covoar')
-rw-r--r--tester/covoar/ReportsBase.cc12
-rw-r--r--tester/covoar/ReportsHtml.cc82
2 files changed, 39 insertions, 55 deletions
diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc
index 1615c0b..40ed209 100644
--- a/tester/covoar/ReportsBase.cc
+++ b/tester/covoar/ReportsBase.cc
@@ -290,15 +290,9 @@ void ReportsBase::WriteBranchReport(
if (!report)
return;
- // If no branches were found of branch coverage is not supported
- if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
- (BranchInfoAvailable == false) ) {
-
- PutNoBranchInfo(report);
-
- // If branches were found, ...
- } else {
-
+ // If no branches were found then branch coverage is not supported
+ if ((SymbolsToAnalyze->getNumberBranchesFound() != 0) &&
+ (BranchInfoAvailable == true) ) {
// Process uncovered branches for each symbol.
count = 0;
for (ditr = SymbolsToAnalyze->set.begin();
diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc
index 3d20aec..6406a48 100644
--- a/tester/covoar/ReportsHtml.cc
+++ b/tester/covoar/ReportsHtml.cc
@@ -172,45 +172,43 @@ namespace Coverage {
// Open the file
aFile = OpenFile(fileName);
- if ( hasBranches ) {
- // Put header information into the file
- fprintf(
- aFile,
- "<title>Branch Report</title>\n"
- "<div class=\"heading-title\">"
- );
-
- if (projectName)
- fprintf(
- aFile,
- "%s<br>",
- projectName
- );
+ // Put header information into the file
+ fprintf(
+ aFile,
+ "<title>Branch Report</title>\n"
+ "<div class=\"heading-title\">"
+ );
+ if (projectName)
fprintf(
aFile,
- "Branch Report</div>\n"
- "<div class =\"datetime\">%s</div>\n"
- "<body>\n"
- "<table class=\"covoar table-autosort:0 table-autofilter table-stripeclass:covoar-tr-odd"
- TABLE_HEADER_CLASS "\">\n"
- "<thead>\n"
- "<tr>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Symbol</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Line</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">File</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"left\">Size <br>Bytes</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Reason</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">Taken</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">Not Taken</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">Classification</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Explanation</th>\n"
- "</tr>\n"
- "</thead>\n"
- "<tbody>\n",
- asctime( localtime(&timestamp_m) )
+ "%s<br>",
+ projectName
);
- }
+
+ fprintf(
+ aFile,
+ "Branch Report</div>\n"
+ "<div class =\"datetime\">%s</div>\n"
+ "<body>\n"
+ "<table class=\"covoar table-autosort:0 table-autofilter table-stripeclass:covoar-tr-odd"
+ TABLE_HEADER_CLASS "\">\n"
+ "<thead>\n"
+ "<tr>\n"
+ "<th class=\"table-sortable:default\" align=\"left\">Symbol</th>\n"
+ "<th class=\"table-sortable:default\" align=\"left\">Line</th>\n"
+ "<th class=\"table-filterable table-sortable:default\" align=\"left\">File</th>\n"
+ "<th class=\"table-sortable:numeric\" align=\"left\">Size <br>Bytes</th>\n"
+ "<th class=\"table-sortable:default\" align=\"left\">Reason</th>\n"
+ "<th class=\"table-filterable table-sortable:default\" align=\"left\">Taken</th>\n"
+ "<th class=\"table-filterable table-sortable:default\" align=\"left\">Not Taken</th>\n"
+ "<th class=\"table-filterable table-sortable:default\" align=\"left\">Classification</th>\n"
+ "<th class=\"table-sortable:default\" align=\"left\">Explanation</th>\n"
+ "</tr>\n"
+ "</thead>\n"
+ "<tbody>\n",
+ asctime( localtime(&timestamp_m) )
+ );
return aFile;
}
@@ -985,19 +983,11 @@ namespace Coverage {
bool hasBranches
)
{
- if ( hasBranches ) {
- fprintf(
- aFile,
- TABLE_FOOTER
- "</tbody>\n"
- "</table>\n"
- );
- }
fprintf(
aFile,
- "</pre>\n"
- "</body>\n"
- "</html>"
+ TABLE_FOOTER
+ "</tbody>\n"
+ "</table>\n"
);
CloseFile(aFile);