Changeset 18208f8 in rtems-tools


Ignore:
Timestamp:
Jul 25, 2018, 3:28:25 PM (9 months ago)
Author:
Vijay Kumar Banerjee <vijaykumar9597@…>
Branches:
master
Children:
458a144
Parents:
d343f83
git-author:
Vijay Kumar Banerjee <vijaykumar9597@…> (07/25/18 15:28:25)
git-committer:
Joel Sherrill <joel@…> (08/08/18 16:26:32)
Message:

Coverage: Add support to generate separate reports for each symbol-set

Invoke covoar multiple times from the script to generate separate
reports for each symbol-set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester/rt/coverage.py

    rd343f83 r18208f8  
    100100
    101101class report_gen_html:
    102     def __init__(self, p_symbol_sets_list, build_dir, rtdir, bsp):
    103         self.symbol_sets_list = ['score']
     102    def __init__(self, symbol_sets, build_dir, rtdir, bsp):
     103        self.symbol_sets = symbol_sets
    104104        self.build_dir = build_dir
    105105        self.partial_reports_files = list(['index.html', 'summary.txt'])
     
    110110    def _find_partial_reports(self):
    111111        partial_reports = {}
    112         for symbol_set in self.symbol_sets_list:
     112        for symbol_set in self.symbol_sets:
    113113            set_summary = summary(path.join(self.bsp + "-coverage",
    114114                                            symbol_set))
     
    205205        table_js_path = path.join(self.covoar_src_path, 'table.js')
    206206        covoar_css_path = path.join(self.covoar_src_path, 'covoar.css')
    207         for symbol_set in self.symbol_sets_list:
     207        for symbol_set in self.symbol_sets:
    208208            symbol_set_dir = path.join(self.build_dir,
    209209                                       self.bsp + '-coverage', symbol_set)
     
    265265                lib = path.join(self.build_dir, config.get('libraries', sset))
    266266                self.symbol_sets[sset] = lib.encode('utf-8')
     267            return self.ssets
    267268        except:
    268269            raise error.general('Symbol set parsing failed')
    269270
    270     def _write_ini(self):
     271    def write_ini(self, symbol_set):
    271272        config = configparser.ConfigParser()
    272273        try:
    273             sets = ', '.join(self.symbol_sets.keys())
     274            sset = symbol_set
    274275            config.add_section('symbol-sets')
    275             config.set('symbol-sets', 'sets', sets)
    276             for key in self.symbol_sets.keys():
    277                 config.add_section(key)
    278                 config.set(key, 'libraries', self.symbol_sets[key])
     276            config.set('symbol-sets', 'sets', sset)
     277            config.add_section(sset)
     278            config.set(sset, 'libraries', self.symbol_sets[sset])
    279279            with open(self.symbol_select_file, 'w') as conf:
    280280                config.write(conf)
    281281        except:
    282282            raise error.general('symbol parser write failed')
    283 
    284     def run(self):
    285         self.parse()
    286         self._write_ini()
    287283
    288284class covoar(object):
     
    372368                                   self.symbol_set,
    373369                                   build_dir)
    374             parser.run()
    375             covoar_runner = covoar(self.test_dir, self.symbol_select_path,
     370            symbol_sets = parser.parse()
     371            for sset in symbol_sets:
     372                parser.write_ini(sset)
     373                covoar_runner = covoar(self.test_dir, self.symbol_select_path,
    376374                                   self.executables, self.explanations_txt,
    377375                                   self.trace)
    378             covoar_runner.run('score', self.symbol_select_path)
    379             self._generate_reports();
     376                covoar_runner.run(sset, self.symbol_select_path)
     377            self._generate_reports(symbol_sets);
    380378            self._summarize();
    381379        finally:
    382380            self._cleanup();
    383381
    384     def _generate_reports(self):
     382    def _generate_reports(self, symbol_sets):
    385383        log.notice('Coverage generating reports')
    386384        if self.report_format == 'html':
    387             report = report_gen_html(self.symbol_sets,
     385            report = report_gen_html(symbol_sets,
    388386                                     self.build_dir,
    389387                                     self.rtdir,
Note: See TracChangeset for help on using the changeset viewer.