<div dir="ltr"><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br></div></div></div></div></div><div class="gmail_quote">On 30 July 2018 at 06:27, Chris Johns <span dir="ltr"><<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 26/07/2018 01:40, Vijay Kumar Banerjee wrote:<br>
> Invoke covoar multiple times from the script to generate separate<br>
> reports for each symbol-set.<br>
> ---<br>
>  tester/rt/coverage.py | 42 ++++++++++++++++++++----------<wbr>------------<br>
>  1 file changed, 20 insertions(+), 22 deletions(-)<br>
> <br>
> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py<br>
> index 7dd5002..fe92d0a 100644<br>
> --- a/tester/rt/coverage.py<br>
> +++ b/tester/rt/coverage.py<br>
> @@ -100,7 +100,7 @@ class summary:<br>
>  <br>
>  class report_gen_html:<br>
>      def __init__(self, p_symbol_sets_list, build_dir, rtdir, bsp):<br>
<br>
</span>I am not a fan of adding type info to variable names, for example<br>
'p_symbol_sets_list' where a design change may make this a dict. Please use<br>
something else.<br></blockquote><div>Understood. Thanks. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> -        self.symbol_sets_list = ['score']<br>
> +        self.symbol_sets_list = p_symbol_sets_list<br>
<br>
<br>
>          self.build_dir = build_dir<br>
>          self.partial_reports_files = list(['index.html', 'summary.txt'])<br>
>          self.number_of_columns = 1<br>
> @@ -250,41 +250,37 @@ class symbol_parser(object):<br>
>          self.build_dir = build_dir<br>
>          self.symbol_sets = {}<br>
>          self.symbol_set = symbol_set<br>
> -        self.ssets = []<br>
> +        self.symbol_set_list = []<br>
<br>
</span>Same here and so on in the patch. Also I do not think this last change is needed.<br></blockquote><div>Understood. I'll remove this last change.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Chris<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
>  <br>
>      def parse(self):<br>
>          config = configparser.ConfigParser()<br>
>          try:<br>
>              config.read(self.symbol_file)<br>
>              if self.symbol_set is not None:<br>
> -                self.ssets = self.symbol_set.split(',')<br>
> +                self.symbol_set_list = self.symbol_set.split(',')<br>
>              else:<br>
> -                self.ssets = config.get('symbol-sets', 'sets').split(',')<br>
> -                self.ssets = [sset.encode('utf-8') for sset in self.ssets]<br>
> -            for sset in self.ssets:<br>
> +                self.symbol_set_list = config.get('symbol-sets', 'sets').split(',')<br>
> +                self.symbol_set_list = [sset.encode('utf-8') for sset in self.symbol_set_list]<br>
> +            for sset in self.symbol_set_list:<br>
>                  lib = path.join(self.build_dir, config.get('libraries', sset))<br>
>                  self.symbol_sets[sset] = lib.encode('utf-8')<br>
> +            return self.symbol_set_list <br>
>          except:<br>
>              raise error.general('Symbol set parsing failed')<br>
>  <br>
> -    def _write_ini(self):<br>
> +    def write_ini(self, symbol_set):<br>
>          config = configparser.ConfigParser()<br>
>          try:<br>
> -            sets = ', '.join(self.symbol_sets.keys()<wbr>)<br>
> +            sset = symbol_set<br>
>              config.add_section('symbol-<wbr>sets')<br>
> -            config.set('symbol-sets', 'sets', sets)<br>
> -            for key in self.symbol_sets.keys():<br>
> -                config.add_section(key)<br>
> -                config.set(key, 'libraries', self.symbol_sets[key])<br>
> +            config.set('symbol-sets', 'sets', sset)<br>
> +            config.add_section(sset)<br>
> +            config.set(sset, 'libraries', self.symbol_sets[sset])<br>
>              with open(self.symbol_select_file, 'w') as conf:<br>
>                  config.write(conf)<br>
>          except:<br>
>              raise error.general('symbol parser write failed')<br>
>  <br>
> -    def run(self):<br>
> -        self.parse()<br>
> -        self._write_ini()<br>
> -<br>
>  class covoar(object):<br>
>      '''<br>
>      Covoar runner<br>
> @@ -371,20 +367,22 @@ class coverage_run(object):<br>
>                                     self.symbol_select_path,<br>
>                                     self.symbol_set,<br>
>                                     build_dir)<br>
> -            parser.run()<br>
> -            covoar_runner = covoar(self.test_dir, self.symbol_select_path,<br>
> +            symbol_set_list = parser.parse()<br>
> +            for sset in symbol_set_list:<br>
> +                parser.write_ini(sset)<br>
> +                covoar_runner = covoar(self.test_dir, self.symbol_select_path,<br>
>                                     self.executables, self.explanations_txt,<br>
>                                     self.trace)<br>
> -            covoar_runner.run('score', self.symbol_select_path)<br>
> -            self._generate_reports();<br>
> +                covoar_runner.run(sset, self.symbol_select_path)<br>
> +            self._generate_reports(symbol_<wbr>set_list);<br>
>              self._summarize();<br>
>          finally:<br>
>              self._cleanup();<br>
>  <br>
> -    def _generate_reports(self):<br>
> +    def _generate_reports(self, symbol_sets):<br>
>          log.notice('Coverage generating reports')<br>
>          if self.report_format == 'html':<br>
> -            report = report_gen_html(self.symbol_<wbr>sets,<br>
> +            report = report_gen_html(symbol_sets,<br>
>                                       self.build_dir,<br>
>                                       self.rtdir,<br>
>                                       self.macros['bsp'])<br>
> <br>
</div></div></blockquote></div><br></div></div>