Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Tl;dr: The code coverage files that LLVM outputs are newer than the ones expected by gcovr. If you replace your version of gcovr with the linked version (version 2.4), then it should work. Maybe.</strong> </p> <p>Back before LLVM, Xcode used GCC as its compiler. GCC included a tool called 'gcov', which generated all those files, .gcno, .gcda and their ilk.</p> <p>Back then, Macs came preinstalled (and still do) with GCC version 4.2. So Xcode would compile your project with gcc 4.2, and then run gcov version 4.2, which would generate 4.2-versioned test coverage files. This worked fine for gcovr, because the pre-2.0 alpha version seems to have been written with gcov 4.2 in mind.</p> <p>But when Apple switched to LLVM, things went squirrely. LLVM also outputs gcov-style test coverage files, if you set the 'Generate Test Coverage Files' flag in your target settings. BUT, LLVM defaults to outputting gcov 4.4 files, NOT 4.2. </p> <p><a href="https://stackoverflow.com/questions/10883412/how-to-change-the-gcno-version-compiled-by-xcode4-3s-apple-llvm-compiler">This person</a> had the idea that if we could tell LLVM to output the 4.2 version of the files (I think it may technically be able to), then it would solve the problem. That's probably true, but I don't know how to do that.</p> <p>I did however, find a solution for myself. I opened up terminal, and checked my version of gcovr:</p> <pre><code>gcovr --version </code></pre> <p>It told me that my version of gcovr was actually gcovr 2.0-prerelease. <strong>This version doesn't support the gcov 4.4 versions of the test coverage files.</strong></p> <p>So I found a version that does. </p> <p>Here's the page where it is hosted: <a href="https://software.sandia.gov/trac/fast/wiki/gcovr" rel="nofollow noreferrer">https://software.sandia.gov/trac/fast/wiki/gcovr</a></p> <p>And here is the link to the script itself: <a href="https://software.sandia.gov/trac/fast/export/2800/gcovr/trunk/scripts/gcovr" rel="nofollow noreferrer">https://software.sandia.gov/trac/fast/export/2800/gcovr/trunk/scripts/gcovr</a></p> <p>This script is gcovr 2.4, which supports up to gcc 4.8. Theoretically, it should be quite happy with the 4.4 versions of the test coverage files that LLVM outputs. That warning is now completely gone for me. Give it a shot, let me know how it goes!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload