<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 25 July 2018 at 20:06, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Jul 24, 2018 at 10:37 PM, Vijay Kumar Banerjee<br>
<<a href="mailto:vijaykumar9597@gmail.com">vijaykumar9597@gmail.com</a>> wrote:<br>
> Invoke covoar multiple times from the script to generate separate<br>
> reports for each symbol-set.<br>
> ---<br>
> tester/rt/coverage.py | 32 +++++++++++++--------------<br>
> tester/rtems/testing/coverage/<wbr>symbol-sets.ini | 11 ++++++---<br>
> 2 files changed, 23 insertions(+), 20 deletions(-)<br>
><br>
> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py<br>
> index 7dd5002..e2f4dca 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>
> - self.symbol_sets_list = ['score']<br>
> + self.symbol_sets_list = p_symbol_sets_list<br>
> self.build_dir = build_dir<br>
> self.partial_reports_files = list(['index.html', 'summary.txt'])<br>
> self.number_of_columns = 1<br>
> @@ -267,24 +267,19 @@ class symbol_parser(object):<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 +366,23 @@ 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>
> + parser.parse()<br>
> + ssets = parser.symbol_sets.keys()<br>
</div></div>I don't like this two-line combination. It requires knowledge about<br>
the internal workings of the parser class. Maybe it makes sense to<br>
have parser.parse() returns the symbol_sets directly?</blockquote><div>Understood, thanks. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Also, I prefer if you kept symbol_sets as a name, but you can use the<br>
sset for the shortened single "symbol_set". the intermixing of<br>
symbol_sets, sset, and ssets is confusing to me.<br>
<span class=""><br></span></blockquote><div>Will change it to symbol_sets. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
> + for sset in ssets:<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(ssets);<br>
</span>You could keep the symbol_sets as a class variable if you want to.<br>
either way is probably fine...<br>
<div class="HOEnZb"><div class="h5"><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>
> diff --git a/tester/rtems/testing/<wbr>coverage/symbol-sets.ini b/tester/rtems/testing/<wbr>coverage/symbol-sets.ini<br>
> index a2ec7bc..3900f14 100644<br>
> --- a/tester/rtems/testing/<wbr>coverage/symbol-sets.ini<br>
> +++ b/tester/rtems/testing/<wbr>coverage/symbol-sets.ini<br>
> @@ -29,8 +29,13 @@<br>
> #<br>
><br>
> [symbol-sets]<br>
> -sets = score,rtems<br>
> +sets = score,rtems,libblock,libcrypt,<wbr>libcsupport,libmd,<wbr>libnetworking<br>
><br>
> [libraries]<br>
> -score = @BUILD-TARGET@/c/@BSP@/cpukit/<wbr>score/libscore.a<br>
> -rtems = @BUILD-TARGET@/c/@BSP@/cpukit/<wbr>rtems/librtems.a<br>
> +score = @BUILD-TARGET@/c/@BSP@/cpukit/<wbr>score/libscore.a<br>
> +rtems = @BUILD-TARGET@/c/@BSP@/cpukit/<wbr>rtems/librtems.a<br>
> +libblock = @BUILD-TARGET@/c/@BSP@/cpukit/<wbr>libblock/libblock.a<br>
> +libcrypt = @BUILD-TARGET@/c/@BSP@/cpukit/<wbr>libcrypt/libcrypt.a<br>
> +libcsupport = @BUILD-TARGET@/c/@BSP@/cpukit/<wbr>libcsupport/libcsupport.a<br>
> +libmd = @BUILD-TARGET@/c/@BSP@/cpukit/<wbr>libmd/libmd.a<br>
> +libnetworking = @BUILD-TARGET@/c/@BSP@/cpukit/<wbr>libnetworking/libnetworking.a<br>
> --<br>
> 2.14.2<br>
><br>
</div></div></blockquote></div><br></div></div>