<br><br><div class="gmail_quote">On Wed, Apr 11, 2012 at 8:49 PM, francis <span dir="ltr">&lt;<a href="mailto:francismb@email.de">francismb@email.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I would like to have line and branch coverage of a Python C-extension by<br>
using gcc-coverage (gcov). AFAIN to be able to use gcov for that, the extension<br>
module has to be compiled statically: means in that case the interpreter, the<br>
tests (written in python with unittest) and the C-extension itself. I wonder if that<br>
can be achieved with py2exe or some of it&#39;s pendants...<br>
<br>
If someone has already gone that path or did something similar … any idea is<br>
appreciated.<br></blockquote><div><br></div><div>That&#39;s tricky. As you mentioned, gcov does not work with shared libraries as is, so you need to statically link your extensions into python: that&#39;s not easy either.</div>
<div><br></div><div>I think in the short term, using clang new coverage abilities is the most promising approach, but it is still unstable in my experience:</div><div><br></div><div><a href="http://mattrajca.com/post/8749868513/llvm-code-coverage-and-xcode-4">http://mattrajca.com/post/8749868513/llvm-code-coverage-and-xcode-4</a></div>
<div><br></div><div>David</div></div>