Changeset 53dd5e6 in rtems-tools


Ignore:
Timestamp:
Mar 22, 2019, 10:40:18 PM (2 months ago)
Author:
Vijay Kumar Banerjee <vijaykumar9597@…>
Branches:
master
Children:
925448a
Parents:
8dcfc0e
git-author:
Vijay Kumar Banerjee <vijaykumar9597@…> (03/22/19 22:40:18)
git-committer:
Joel Sherrill <joel@…> (03/27/19 22:25:45)
Message:

coverage: Add subdirectory name in HTML reports

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester/rt/coverage.py

    r8dcfc0e r53dd5e6  
    211211            path.copy_tree(covoar_css_path, symbol_set_dir)
    212212            path.copy_tree(table_js_path, symbol_set_dir)
     213
     214    def add_dir_name(self):
     215        for symbol_set in self.symbol_sets:
     216             symbol_set_dir = path.join(self.build_dir,
     217                                        self.bsp + '-coverage', symbol_set)
     218             html_files = os.listdir(symbol_set_dir)
     219             for html_file in html_files:
     220                 html_file = path.join(symbol_set_dir, html_file)
     221                 if path.exists(html_file) and 'html' in html_file:
     222                     with open(html_file, 'r') as f:
     223                         file_data = f.read()
     224                     text = file_data[file_data.find('<div class="heading-title">')\
     225                                     +len('<div class="heading-title">') \
     226                                     : file_data.find('</div')]
     227                     file_data = file_data.replace(text, text + '<br>' + symbol_set)
     228                     with open(html_file, 'w') as f:
     229                         f.write(file_data)
    213230
    214231class build_path_generator(object):
     
    407424            report.generate()
    408425            report.add_covoar_css()
     426            report.add_dir_name()
    409427
    410428    def _cleanup(self):
Note: See TracChangeset for help on using the changeset viewer.