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

[proposal] test coverage output #18860

Closed
RossComputerGuy opened this issue Feb 8, 2024 · 4 comments
Closed

[proposal] test coverage output #18860

RossComputerGuy opened this issue Feb 8, 2024 · 4 comments

Comments

@RossComputerGuy
Copy link
Contributor

It would be useful to have like a dot graphs generation or HTML output generation of a module's test coverage. Maybe it could show which lines have test failures along with the error? A lot of test frameworks have this ability and so having this could make it easier to determine what has been tested and what has not been tested.

@squeek502
Copy link
Collaborator

squeek502 commented Feb 8, 2024

If you haven't seen it, here's a way to get coverage with status-quo Zig: https://zig.news/squeek502/code-coverage-for-zig-1dk1

Note also that both comptime and unreferenced functions make "accurate" coverage tricky.

Somewhat related (since built-in coverage would depend on instrumentation): #5484

@RossComputerGuy
Copy link
Contributor Author

@squeek502 Yeah those do look nice but I believe something in Zig itself would be better imo. Those look like they rely on debug info and the symbol table. Using the actual Zig AST and/or the test runner could give better test coverage output.

@VisenDev
Copy link

Possibly related

#17821

@squeek502
Copy link
Collaborator

Duplicate of #352

@squeek502 squeek502 marked this as a duplicate of #352 Feb 23, 2024
@squeek502 squeek502 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants