This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Script: find untested C functions
Type: enhancement Stage:
Components: Tests Versions: Python 3.0, Python 2.6
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ajaksu2
Priority: normal Keywords:

Created on 2008-09-12 01:32 by ajaksu2, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit ajaksu2, 2008-09-12 01:32 Script that lists C functions not covered by the test suite
uncovered.txt ajaksu2, 2008-09-12 01:40 Output from ccoverage on 3.0
Messages (3)
msg73073 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2008-09-12 01:32
The attached script reports C functions not flexed by unittests. It
needs a 'coverage' build and a run of the tests. Coverage data is then
passed to gcov and those functions with zero calls written to a text
file, grouped by source file.

It's also pretty ugly.

Reviews/suggestions are most welcome :)

I'm finishing a related script that patches the source with 'printf's,
so any false positives are easy to spot and it's clear when some action
or test exercises a previously untested C function. It already works,
but is much uglier then this one ;)
msg73075 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2008-09-12 01:40
Here's example output of a run against 3.0. The number after a function
name is its length in lines (as gcov counts them :).

False positives include:
./Objects/weakrefobject.c gc_clear
./Modules/readline.c on_completion_display_matches_hook
msg81622 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-02-11 04:13
Closing: resource available externally ( )
Date User Action Args
2022-04-11 14:56:39adminsetgithub: 48094
2009-02-11 04:13:26ajaksu2setstatus: open -> closed
resolution: not a bug
messages: + msg81622
2008-09-12 01:41:00ajaksu2setfiles: + uncovered.txt
messages: + msg73075
2008-09-12 01:32:06ajaksu2create