summaryrefslogtreecommitdiffstats
path: root/tester/covoar/ReportsBase.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/ReportsBase.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/ReportsBase.cc')
-rw-r--r--tester/covoar/ReportsBase.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc
index 0be5567..1615c0b 100644
--- a/tester/covoar/ReportsBase.cc
+++ b/tester/covoar/ReportsBase.cc
@@ -161,6 +161,24 @@ void ReportsBase::CloseSymbolSummaryFile(
CloseFile( aFile );
}
+std::string expand_tabs(const std::string& in) {
+ std::string expanded = "";
+ int i = 0;
+
+ for (char c : in) {
+ if (c == '\t') {
+ int num_tabs = 4 - (i % 4);
+ expanded.append(num_tabs, ' ');
+ i += num_tabs;
+ } else {
+ expanded += c;
+ i++;
+ }
+ }
+
+ return expanded;
+}
+
/*
* Write annotated report
*/
@@ -237,7 +255,8 @@ void ReportsBase::WriteAnnotatedReport(
}
}
- snprintf( textLine, LINE_LENGTH, "%-70s", itr->line.c_str() );
+ std::string textLineWithoutTabs = expand_tabs(itr->line);
+ snprintf( textLine, LINE_LENGTH, "%-90s", textLineWithoutTabs.c_str() );
line = textLine + annotation;
PutAnnotatedLine( aFile, state, line, id);