Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script: find untested C functions #48094

Closed
devdanzin mannequin opened this issue Sep 12, 2008 · 3 comments
Closed

Script: find untested C functions #48094

devdanzin mannequin opened this issue Sep 12, 2008 · 3 comments
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Sep 12, 2008

BPO 3844
Nosy @devdanzin
Files
  • ccoverage.py: Script that lists C functions not covered by the test suite
  • uncovered.txt: Output from ccoverage on 3.0
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2009-02-11.04:13:26.542>
    created_at = <Date 2008-09-12.01:32:06.499>
    labels = ['invalid', 'type-feature', 'tests']
    title = 'Script: find untested C functions'
    updated_at = <Date 2009-02-11.04:13:26.541>
    user = 'https://github.com/devdanzin'

    bugs.python.org fields:

    activity = <Date 2009-02-11.04:13:26.541>
    actor = 'ajaksu2'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-02-11.04:13:26.542>
    closer = 'ajaksu2'
    components = ['Tests']
    creation = <Date 2008-09-12.01:32:06.499>
    creator = 'ajaksu2'
    dependencies = []
    files = ['11469', '11471']
    hgrepos = []
    issue_num = 3844
    keywords = []
    message_count = 3.0
    messages = ['73073', '73075', '81622']
    nosy_count = 1.0
    nosy_names = ['ajaksu2']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue3844'
    versions = ['Python 2.6', 'Python 3.0']

    @devdanzin
    Copy link
    Mannequin Author

    devdanzin mannequin commented Sep 12, 2008

    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 ;)

    @devdanzin devdanzin mannequin added tests Tests in the Lib/test dir type-feature A feature request or enhancement labels Sep 12, 2008
    @devdanzin
    Copy link
    Mannequin Author

    devdanzin mannequin commented Sep 12, 2008

    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

    @devdanzin
    Copy link
    Mannequin Author

    devdanzin mannequin commented Feb 11, 2009

    Closing: resource available externally (
    http://bazaar.launchpad.net/~ajaksu/ccoverage/trunk/files )

    @devdanzin devdanzin mannequin closed this as completed Feb 11, 2009
    @devdanzin devdanzin mannequin added the invalid label Feb 11, 2009
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants