summaryrefslogtreecommitdiffstats
path: root/tester/covoar/ReportsText.cc
diff options
context:
space:
mode:
authorAlex White <alex.white@oarcorp.com>2021-02-25 10:47:58 -0600
committerJoel Sherrill <joel@rtems.org>2021-03-30 13:15:58 -0500
commit04597495e59eba0bfa5c7935c30ee326fdc2c006 (patch)
tree57ab21428c3907017a43ad8d9704bb857d1a83b3 /tester/covoar/ReportsText.cc
parentcovoar/reports: Add new statistics to summary (diff)
downloadrtems-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/ReportsText.cc')
-rw-r--r--tester/covoar/ReportsText.cc76
1 files changed, 45 insertions, 31 deletions
diff --git a/tester/covoar/ReportsText.cc b/tester/covoar/ReportsText.cc
index 33d3509..a3923e6 100644
--- a/tester/covoar/ReportsText.cc
+++ b/tester/covoar/ReportsText.cc
@@ -52,7 +52,7 @@ bool ReportsText::PutNoBranchInfo(
FILE* report
)
{
- if ( BranchInfoAvailable )
+ if ( BranchInfoAvailable && SymbolsToAnalyze->getNumberBranchesFound() != 0 )
fprintf( report, "All branch paths taken.\n" );
else
fprintf( report, "No branch information found.\n" );
@@ -235,38 +235,52 @@ bool ReportsText::PutSymbolSummaryLine(
float uncoveredBytes;
float uncoveredInstructions;
- if ( symbol->second.stats.sizeInInstructions == 0 )
- uncoveredInstructions = 0;
- else
- uncoveredInstructions = (symbol->second.stats.uncoveredInstructions*100.0)/
- symbol->second.stats.sizeInInstructions;
+ if (symbol->second.stats.sizeInBytes == 0) {
+ fprintf(
+ report,
+ "============================================\n"
+ "Symbol : %s\n"
+ " *** NEVER REFERENCED ***\n\n"
+ "This symbol was never referenced by an analyzed executable.\n"
+ "Therefore there is no size or disassembly for this symbol.\n"
+ "This could be due to symbol misspelling or lack of a test for\n"
+ "this symbol.\n",
+ symbol->first.c_str()
+ );
+ } else {
+ if ( symbol->second.stats.sizeInInstructions == 0 )
+ uncoveredInstructions = 0;
+ else
+ uncoveredInstructions = (symbol->second.stats.uncoveredInstructions*100.0)/
+ symbol->second.stats.sizeInInstructions;
- if ( symbol->second.stats.sizeInBytes == 0 )
- uncoveredBytes = 0;
- else
- uncoveredBytes = (symbol->second.stats.uncoveredBytes*100.0)/
- symbol->second.stats.sizeInBytes;
+ if ( symbol->second.stats.sizeInBytes == 0 )
+ uncoveredBytes = 0;
+ else
+ uncoveredBytes = (symbol->second.stats.uncoveredBytes*100.0)/
+ symbol->second.stats.sizeInBytes;
- fprintf(
- report,
- "============================================\n"
- "Symbol : %s\n"
- "Total Size in Bytes : %d\n"
- "Total Size in Instructions : %d\n"
- "Total number Branches : %d\n"
- "Total Always Taken : %d\n"
- "Total Never Taken : %d\n"
- "Percentage Uncovered Instructions : %.2f\n"
- "Percentage Uncovered Bytes : %.2f\n",
- symbol->first.c_str(),
- symbol->second.stats.sizeInBytes,
- symbol->second.stats.sizeInInstructions,
- symbol->second.stats.branchesNotExecuted + symbol->second.stats.branchesExecuted,
- symbol->second.stats.branchesAlwaysTaken,
- symbol->second.stats.branchesNeverTaken,
- uncoveredInstructions,
- uncoveredBytes
- );
+ fprintf(
+ report,
+ "============================================\n"
+ "Symbol : %s\n"
+ "Total Size in Bytes : %d\n"
+ "Total Size in Instructions : %d\n"
+ "Total number Branches : %d\n"
+ "Total Always Taken : %d\n"
+ "Total Never Taken : %d\n"
+ "Percentage Uncovered Instructions : %.2f\n"
+ "Percentage Uncovered Bytes : %.2f\n",
+ symbol->first.c_str(),
+ symbol->second.stats.sizeInBytes,
+ symbol->second.stats.sizeInInstructions,
+ symbol->second.stats.branchesNotExecuted + symbol->second.stats.branchesExecuted,
+ symbol->second.stats.branchesAlwaysTaken,
+ symbol->second.stats.branchesNeverTaken,
+ uncoveredInstructions,
+ uncoveredBytes
+ );
+ }
fprintf(report, "============================================\n");
return true;