Option to generate and persist a test executable for documentation tests #37048
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-dev-tools
Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
I couldn't find an existing issue for this so I thought I would bring it up. Pardon me if this is a duplicate or in the wrong repository.
I wrote an in depth guide about Rust code coverage a few months ago based on the older guide that had been around for a while. One of the things I wrote about was that you can't currently get code coverage for documentation tests because
cargo test
orcargo test --doc
doesn't output any test executable for documentation tests. The tool being used to generate coverage data, kcov, requires an executable that directly runs the code you want to measure.It would be really helpful if there was a way not to just temporarily generate an executable for documentation tests, but also to have the option to store that executable somewhere (much like how the unit test executable is generated and stored in
target/debug
). That way we can manually run it using whatever tools we please.I'm really surprised that I couldn't find an existing issue for this. There is a StackOverflow question about the issue but it doesn't lead anywhere. Hopefully this is a duplicate and it's been on your radar for some time.
The text was updated successfully, but these errors were encountered: