<div dir="ltr"><div><div><div>Got the same idea.<br></div>Now need to figure out where to host the results.<br><br></div>Thanks<br><br></div>Galina<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 26, 2018 at 9:10 AM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks a lot for doing this.<br>
<br>
Having it automated an in a bot would be really nice.<br>
<br>
Cheers,<br>
Rafael<br>
<div><div class="h5"><br>
George Rimar <<a href="mailto:grimar@accesssoftek.com">grimar@accesssoftek.com</a>> writes:<br>
<br>
> Hello guys,<br>
><br>
> Today I tried to find the amount of LLD(elf) code covered by our test cases. So my aim was to run the LLD tests we have (run check-lld task) and find out which code was executed/covered and which was not.<br>
><br>
> I used the approach from the next article to do that:<br>
> <a href="http://logan.tw/posts/2015/04/28/check-code-coverage-with-clang-and-lcov/#create-a-wrapper-script-for-lcov" rel="noreferrer" target="_blank">http://logan.tw/posts/2015/04/<wbr>28/check-code-coverage-with-<wbr>clang-and-lcov/#create-a-<wbr>wrapper-script-for-lcov</a><br>
><br>
> In short, it is based on using -fprofile-arcs -ftest-coverage clang flags and then generating the HTML report using lcov and genhtml tools.<br>
><br>
> The results are actually not that bad (I expected we would have much more issues, but glad to see we seem don't :)<br>
> Coverage screenshot:<br>
> <a href="https://drive.google.com/file/d/1rjFdMA0HOjvz4vw_nDttv_dlbMiNYiaw/view" rel="noreferrer" target="_blank">https://drive.google.com/file/<wbr>d/1rjFdMA0HOjvz4vw_nDttv_<wbr>dlbMiNYiaw/view</a><br>
><br>
> We have few problematic places, but generally seems we cover the most of the code, except the few specific<br>
> errors and conditions. The full HTML report is available here:<br>
> <a href="https://drive.google.com/file/d/1ROo9rZ4p7-IT68jI0nnhNMOqPNpk1l0c/view?usp=sharing" rel="noreferrer" target="_blank">https://drive.google.com/file/<wbr>d/1ROo9rZ4p7-<wbr>IT68jI0nnhNMOqPNpk1l0c/view?<wbr>usp=sharing</a><br>
><br>
> Noticeable places I have to mention though are (we have some large code parts uncovered):<br>
><br>
> 1) I was able to place `assert(false);` on line 386 below in ICF.cpp and all our tests pass.<br>
> (<a href="https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L386" rel="noreferrer" target="_blank">https://github.com/llvm-<wbr>mirror/lld/blob/master/ELF/<wbr>ICF.cpp#L386</a>)<br>
><br>
> 2) In Relocations.cpp, all code inside `if`:<br>
> <a href="https://github.com/llvm-mirror/lld/blob/master/ELF/Relocations.cpp#L1177" rel="noreferrer" target="_blank">https://github.com/llvm-<wbr>mirror/lld/blob/master/ELF/<wbr>Relocations.cpp#L1177</a><br>
> Is not covered by tests.<br>
><br>
> 3) MicroMipsR6Thunk::writeTo(), MicroMipsR6Thunk::addSymbols()<wbr>,<br>
> MicroMipsR6Thunk::<wbr>getTargetInputSection() are not covered.<br>
><br>
> That seems to be all major places I saw in report.<br>
><br>
> Now we probably can think about what we can do with that?<br>
> * Ideal scenario I can imagine is that we could fix all the places and, for example, setup the watching bot<br>
> looking for LLD code coverage for each commit.<br>
> * Minimal scenario I see is to fix the major known places mentioned at least.<br>
><br>
</div></div>> What do you think guys??<br>
<div class="HOEnZb"><div class="h5">><br>
><br>
> Best regards,<br>
> George | Developer | Access Softek, Inc<br>
</div></div></blockquote></div><br></div>