<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Wed, 13 Jun 2018, 21:39 Gedare Bloom, <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Jun 13, 2018 at 11:58 AM, Vijay Kumar Banerjee<br>
<<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>> wrote:<br>
> On 13 June 2018 at 10:29, Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</a>> wrote:<br>
>><br>
>> On Thu, Jun 7, 2018 at 7:08 AM, Vijay Kumar Banerjee<br>
>> <<a href="mailto:vijaykumar9597@gmail.com" target="_blank" rel="noreferrer">vijaykumar9597@gmail.com</a>> wrote:<br>
>> > Close #3440<br>
>> > ---<br>
>> > tester/rt/coverage.py | 6 ++++--<br>
>> > tester/rt/test.py | 15 ++++++++++-----<br>
>> > 2 files changed, 14 insertions(+), 7 deletions(-)<br>
>> ><br>
>> > diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py<br>
>> > index 54933d5..af24124 100644<br>
>> > --- a/tester/rt/coverage.py<br>
>> > +++ b/tester/rt/coverage.py<br>
>> > @@ -163,7 +163,8 @@ class report_gen_html:<br>
>> > row += " <td>" + summary.branches_uncovered + "</td>"<br>
>> > row += " <td>" + summary.branches_total + "</td>"<br>
>> > row += " <td> {:.3%}<br>
>> > </td>".format(summary.percentage_branches_covered)<br>
>> > - row += ' <td><progress value="{:.3}"<br>
>> > max="100"></progress></td>'.format(100*summary.percentage_branches_covered)<br>
>> > + row += ' <td><progress value="{:.3}"<br>
>> > max="100"></progress></td>'\<br>
>> > + .format(100*summary.percentage_branches_covered)<br>
>><br>
>> Is there a style guide for how to split long lines in Python? I find<br>
>> splitting before the .format seems strange to me. I might have<br>
>> preferred to see it split at .format(\ which probably can be done<br>
>> without using a backslash in this case, since python knows to keep<br>
>> scanning inside a parenthetical block.<br>
><br>
> Will update it according to your suggestion. :)<br>
>><br>
>><br>
>> > row += "</tr>\n"<br>
>> > return row<br>
>> ><br>
>> > @@ -299,7 +300,8 @@ class covoar(object):<br>
>> > if (not path.exists(covoar_result_dir)):<br>
>> > path.mkdir(covoar_result_dir)<br>
>> > if (not path.exists(symbol_file)):<br>
>> > - raise error.general('symbol set file: coverage %s was not<br>
>> > created for covoar, skipping %s'% (symbol_file, set_name))<br>
>> > + raise error.general('symbol set file: %s was not '<br>
>> > + 'created for covoar, skipping %s'% (symbol_file,<br>
>> > set_name))<br>
>><br>
>> ditto.<br>
>><br>
>> > command = ('covoar -S ' + symbol_file<br>
>> > + ' -O ' + covoar_result_dir<br>
>> > + ' -E ' + self.explanations_txt<br>
>> > diff --git a/tester/rt/test.py b/tester/rt/test.py<br>
>> > index 0e744cd..cdb5157 100644<br>
>> > --- a/tester/rt/test.py<br>
>> > +++ b/tester/rt/test.py<br>
>> > @@ -232,7 +232,7 @@ def run(command_path = None):<br>
>> > '--filter': 'Glob that executables must<br>
>> > match to run (default: ' +<br>
>> > default_exefilter + ')',<br>
>> > '--stacktrace': 'Dump a stack trace on a user<br>
>> > termination (^C)',<br>
>> > - '--coverage': 'Perform coverage analysis of<br>
>> > test executables.'}<br>
>> > + '--coverage-sets': 'Perform coverage for specific<br>
>> > sets'}<br>
>> > mailer.append_options(optargs)<br>
>> > opts = options.load(sys.argv,<br>
>> > optargs = optargs,<br>
>> > @@ -279,15 +279,20 @@ def run(command_path = None):<br>
>> > else:<br>
>> > rtems_tools = '%{_prefix}'<br>
>> > bsp = opts.find_arg('--rtems-bsp')<br>
>> > + if 'cov' in bsp[1].split('-'):<br>
>><br>
>> I'm not sure if this use of the 'cov' field in the bsp config filename<br>
>> itself is the proper way to go about accomplishing the activation of<br>
>> coverage. What are other possible ways to get this done? Is the use of<br>
>> a portion of the bsp config filename done elsewhere in tester?<br>
><br>
> This patch was made following Chris' comments in another thread<br>
><br>
> <a href="https://lists.rtems.org/pipermail/devel/2018-June/021931.html" rel="noreferrer noreferrer" target="_blank">https://lists.rtems.org/pipermail/devel/2018-June/021931.html</a><br>
><br>
<br>
I can't be sure, but I don't think his intent was to infer the<br>
coverage from the ini file name. For example, does the tester parse<br>
the ini file name to check for 'qemu' to decide if that target is<br>
being used? Instead, it should look in to the config file to read the<br>
option somehow.<br></blockquote></div></div><div dir="auto">In leon3-qemu.ini the bsp option inside the </div><div dir="auto">config file is set to leon3-qemu.</div><div dir="auto"><br></div><div dir="auto">There's no such special thing added to bsp for coverage.</div><div dir="auto">Only difference we have is that,</div><div dir="auto">the option 'bsp_qemu_cov_opts' is added in the coverage supported file. we can </div><div dir="auto">read the config file to see if this option is present.</div><div dir="auto"><br></div><div dir="auto">Shall I do it this way?</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="auto"></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>><br>
>> > + coverage_enabled = True<br>
>> > if bsp is None or len(bsp) != 2:<br>
>> > raise error.general('RTEMS BSP not provided or an invalid<br>
>> > option')<br>
>> > bsp = config.load(bsp[1], opts)<br>
>> > bsp_config = opts.defaults.expand(opts.defaults['tester'])<br>
>> > - coverage_enabled = opts.find_arg('--coverage')<br>
>> > + coverage_sets = opts.find_arg('--coverage-sets')<br>
>> > if coverage_enabled:<br>
>> > - if len(coverage_enabled) == 2:<br>
>> > - coverage_runner = coverage.coverage_run(opts.defaults,<br>
>> > - coverage_enabled[1],<br>
>> > + if coverage_sets:<br>
>> > + if len(coverage_sets) != 2:<br>
>> > + raise error.general('No sets provided in<br>
>> > --coverage-sets')<br>
>> > + else :<br>
>><br>
>> I don't think there should be a space character before the colon?<br>
><br>
> that's a mistake, I'll correct it. Thanks.<br>
>><br>
>><br>
>> > + coverage_runner =<br>
>> > coverage.coverage_run(opts.defaults,<br>
>> > + coverage_sets[1],<br>
>> > executables)<br>
>> > else:<br>
>> > coverage_runner = coverage.coverage_run(opts.defaults,<br>
>> > 0,<br>
>> > --<br>
>> > 2.14.3<br>
>> ><br>
>> > _______________________________________________<br>
>> > devel mailing list<br>
>> > <a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
>> > <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
><br>
><br>
</blockquote></div></div></div>