[TIP] C-extension coverage
cournape at gmail.com
Mon Apr 16 17:17:57 PDT 2012
On Wed, Apr 11, 2012 at 8:49 PM, francis <francismb at email.de> wrote:
> Hi all,
> I would like to have line and branch coverage of a Python C-extension by
> using gcc-coverage (gcov). AFAIN to be able to use gcov for that, the
> module has to be compiled statically: means in that case the interpreter,
> tests (written in python with unittest) and the C-extension itself. I
> wonder if that
> can be achieved with py2exe or some of it's pendants...
> If someone has already gone that path or did something similar … any idea
That'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's
not easy either.
I think in the short term, using clang new coverage abilities is the most
promising approach, but it is still unstable in my experience:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python