<div dir="ltr"><div dir="ltr"><br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 6 Feb 2019 at 02:35, Chris Johns <<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 6/2/19 1:41 am, Vijay Kumar Banerjee wrote:<br>> On Tue, 5 Feb 2019 at 03:37, Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a><br>> <mailto:<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>>> wrote:<br> On 1/2/19 10:47 pm, Vijay Kumar Banerjee wrote:<br>> > self.trace = trace<br>> > self.prefix = prefix<br>> > + self.bsp = bsp<br>> > <br>> > def _find_covoar(self):<br>> > covoar_exe = 'covoar'<br>> > @@ -316,10 +323,18 @@ class covoar(object):<br>> > if not path.exists(symbol_file):<br>> > raise error.general('coverage: no symbol set file: %s'%<br>> (symbol_file))<br>> > exe = self._find_covoar()<br>> > - command = exe + ' -S ' + symbol_file + \<br>> > - ' -O ' + covoar_result_dir + \<br>> > - ' -E ' + self.explanations_txt + \<br>> > - ' -p ' + self.project_name + ' ' + self.executables<br>> > + if 'qemu' in self.bsp.split('-'):<br>> <br>> Are you checking for 'qemu' in the BSP name? The naming used here is a<br>> convention and making the code depend on a naming convention is fragile. Lets<br>> not do this.<br>> <br>> There is a `%{qemu-cmd}` macro defined which must exist for a qemu run so it is<br>> better to check for this. However ...<br>> <br>> I'm not able to get it with macros.find(). What's the right way to find it?<br>
<br>Find should work and `get` should also work and may be simpler.<br>
<br>> Also, there's a 'cov_format' in <a href="http://testing.mc" rel="noreferrer" target="_blank">testing.mc</a> <<a href="http://testing.mc" rel="noreferrer" target="_blank">http://testing.mc</a>> that is hardcoded<br>> to 'QEMU'. Can this value be updated from the cfg files ?<br>
<br>I do not mind but maybe this logic is not needed if you can create the command<br>line in a .cfg file. This means you can bring the needed options together from<br>the BSP file which could hold the `-f TSIM` option you need and the code here is<br>common for all coverage.<br>
<br>> > + command = exe + ' -S ' + symbol_file + \<br>> > + ' -O ' + covoar_result_dir + \<br>> > + ' -E ' + self.explanations_txt + \<br>> > + ' -p ' + self.project_name + ' ' + self.executables<br>> > + else:<br>> > + command = exe + ' -S ' + symbol_file + \<br>> > + ' -O ' + covoar_result_dir + \<br>> > + ' -E ' + self.explanations_txt + \<br>> > + ' -f TSIM' + \<br>> > + ' -p ' + self.project_name + ' ' + self.executables<br>> <br>> ... I would prefer the command be managed in the config files and this code<br>> removed. Do you think this can be done?<br>> <br>> the exe and the symbol_files are generated by the script itself. I think we have<br>> to call covoar from the script only. <br>
<br>That is fine, it is just the command line that I am asking about.<br>
<br></blockquote><div>something like the attached patch? </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Chris<br>
</blockquote></div></div>