Skip to content

Use of _exit() prevents gcov from working #12

@phf

Description

@phf

You start each test or benchmark in its own process, then use _exit(0) to get rid of it. I was trying to get test coverage to work and it seems that the code added by --coverage registers an atexit() function to write out the collected data. But atexit() functions don't run when _exit() is used to end a process. I replaced _exit(0) with exit(0) in ct/ct.c and that seems to work, now it's producing coverage data. (There may still be a problem with the coverage stuff not being process-safe, I need to investigate some more.) The real question is whether you're using _exit() instead of exit() for some deeper reason that I fail to understand. If it doesn't matter for ct, I'd suggest replacing _exit() with exit() everywhere so we have a chance to get coverage information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions