Brett Cannon  committed dac396a Draft

Give instructions on how to get the most complete code coverage
possible with a proper warning that it uses a horrible hack that no
one should use.

  • Participants
  • Parent commits 6047ffc

Comments (0)

Files changed (1)

File coverage.rst

 also what branch paths were not executed.
+Coverage Results For Modules Imported Early On
+For the *truly truly* daring, you can use a hack to get to include
+coverage for modules that are imported early on during CPython's startup (e.g.
+the encodings module). Do not worry if you can't get this to work or it doesn't
+make any sense; it's entirely optional and only important for a small number of
+If you still choose to try this, the first step is to build's C
+extension code. Assuming that's clone is at ``COVERAGEDIR`` and
+your clone of CPython is at ``CPYTHONDIR``, you execute the following in your clone::
+  CPPFLAGS="-I CPYTHONDIR -I CPYTHONDIR/Include" CPYTHONDIR/python build_ext --inplace
+This will build's C extension code in-place, allowing the previous
+instructions on how to gather coverage to continue to work.
+To get to be able to gather the most accurate coverage data on as
+many modules as possible
+**with a HORRIBLE HACK that you should NEVER use in your own code**, run the
+following from your CPython clone::
+  PYTHONPATH=COVERAGEDIR/coverage/fullcoverage ./python COVERAGEDIR run --pylib Lib/test/
+This will give you the most complete coverage possible for CPython's standard