<div dir="ltr">On 13 June 2018 at 10:29, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Thu, Jun 7, 2018 at 7:08 AM, Vijay Kumar Banerjee<br>
<<a href="mailto:vijaykumar9597@gmail.com">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%} </td>".format(summary.<wbr>percentage_branches_covered)<br>
> - row += ' <td><progress value="{:.3}" max="100"></progress></td>'.<wbr>format(100*summary.percentage_<wbr>branches_covered)<br>
> + row += ' <td><progress value="{:.3}" max="100"></progress></td>'\<br>
> + .format(100*summary.<wbr>percentage_branches_covered)<br>
<br>
</span>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></blockquote><div>Will update it according to your suggestion. :) <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> row += "</tr>\n"<br>
> return row<br>
><br>
> @@ -299,7 +300,8 @@ class covoar(object):<br>
> if (not path.exists(covoar_result_dir)<wbr>):<br>
> path.mkdir(covoar_result_dir)<br>
> if (not path.exists(symbol_file)):<br>
> - raise error.general('symbol set file: coverage %s was not 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, set_name))<br>
<br>
</span>ditto.<br>
<span class="gmail-"><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 match to run (default: ' +<br>
> default_exefilter + ')',<br>
> '--stacktrace': 'Dump a stack trace on a user termination (^C)',<br>
> - '--coverage': 'Perform coverage analysis of test executables.'}<br>
> + '--coverage-sets': 'Perform coverage for specific 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>
</span>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></blockquote><div>This patch was made following Chris' comments in another thread</div><div><br></div><div><a href="https://lists.rtems.org/pipermail/devel/2018-June/021931.html">https://lists.rtems.org/pipermail/devel/2018-June/021931.html</a></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> + coverage_enabled = True<br>
> if bsp is None or len(bsp) != 2:<br>
> raise error.general('RTEMS BSP not provided or an invalid option')<br>
> bsp = config.load(bsp[1], opts)<br>
> bsp_config = opts.defaults.expand(opts.<wbr>defaults['tester'])<br>
> - coverage_enabled = opts.find_arg('--coverage')<br>
> + coverage_sets = opts.find_arg('--coverage-<wbr>sets')<br>
> if coverage_enabled:<br>
> - if len(coverage_enabled) == 2:<br>
> - coverage_runner = coverage.coverage_run(opts.<wbr>defaults,<br>
> - coverage_enabled[1],<br>
> + if coverage_sets:<br>
> + if len(coverage_sets) != 2:<br>
> + raise error.general('No sets provided in --coverage-sets')<br>
> + else :<br>
<br>
</span>I don't think there should be a space character before the colon?<br></blockquote><div>that's a mistake, I'll correct it. Thanks. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-im gmail-HOEnZb"><br>
> + coverage_runner = coverage.coverage_run(opts.<wbr>defaults,<br>
> + coverage_sets[1],<br>
> executables)<br>
> else:<br>
> coverage_runner = coverage.coverage_run(opts.<wbr>defaults, 0,<br>
> --<br>
> 2.14.3<br>
><br>
</span><div class="gmail-HOEnZb"><div class="gmail-h5">> ______________________________<wbr>_________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div></div>