summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Kumar Banerjee <vijaykumar9597@gmail.com>2019-03-23 04:10:18 +0530
committerJoel Sherrill <joel@rtems.org>2019-03-27 17:25:45 -0500
commit53dd5e656a9990a918194032af9d245ee33a45d4 (patch)
treeaaf3247d30928292c82fca524e4fe47624b15a4f
parent8dcfc0ed8a4298fe01cbe9f525fc1025f1ecf9f5 (diff)
coverage: Add subdirectory name in HTML reports
-rw-r--r--tester/rt/coverage.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
index 3e722cb..bdf3c5f 100644
--- a/tester/rt/coverage.py
+++ b/tester/rt/coverage.py
@@ -211,6 +211,23 @@ class report_gen_html:
path.copy_tree(covoar_css_path, symbol_set_dir)
path.copy_tree(table_js_path, symbol_set_dir)
+ def add_dir_name(self):
+ for symbol_set in self.symbol_sets:
+ symbol_set_dir = path.join(self.build_dir,
+ self.bsp + '-coverage', symbol_set)
+ html_files = os.listdir(symbol_set_dir)
+ for html_file in html_files:
+ html_file = path.join(symbol_set_dir, html_file)
+ if path.exists(html_file) and 'html' in html_file:
+ with open(html_file, 'r') as f:
+ file_data = f.read()
+ text = file_data[file_data.find('<div class="heading-title">')\
+ +len('<div class="heading-title">') \
+ : file_data.find('</div')]
+ file_data = file_data.replace(text, text + '<br>' + symbol_set)
+ with open(html_file, 'w') as f:
+ f.write(file_data)
+
class build_path_generator(object):
'''
Generates the build path from the path to executables
@@ -406,6 +423,7 @@ class coverage_run(object):
self.macros['bsp'])
report.generate()
report.add_covoar_css()
+ report.add_dir_name()
def _cleanup(self):
if not self.no_clean: