-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Coverage with doctests #1080
Comments
Yes. See https://github.com/taiki-e/cargo-llvm-cov?tab=readme-ov-file#merge-coverages-generated-under-different-test-conditions (or https://github.com/taiki-e/cargo-llvm-cov?tab=readme-ov-file#get-coverage-of-external-tests) for details. |
Worth documenting this at https://nexte.st/book/test-coverage.html. |
Awesome, thanks for the hint. I think I got this working with https://github.com/pluots/zspell/blob/045c758f15df8ace6d7a633c2f0c52d1448ff936/.github/workflows/validation-rust.yaml#L79-L93 |
Ah maybe that doesn't work quite right. I definitely use a function in a doctest here https://app.codecov.io/gh/pluots/zspell/commit/045c758f15df8ace6d7a633c2f0c52d1448ff936/blob/zspell/src/lib.rs#L36 but it still shows up as uncovered here https://app.codecov.io/gh/pluots/zspell/commit/045c758f15df8ace6d7a633c2f0c52d1448ff936/blob/zspell/src/lib.rs#L161 |
Oh, that's a cargo-llvm-cov bug. It should be fixed by passing |
Thanks for the quick fix! Seems to work now with my CI setup at https://github.com/pluots/zspell/blob/f342249d360163c30cd5eba2bcca3af1439ba633/.github/workflows/validation-rust.yaml#L79-L93 |
Added documentation. |
Nextest unfortunately can't support doctests yet (#16), but is there a way to have test coverage report include doctests?
Maybe
cargo-llvm-cov
can somehow combine the reports ofcargo llvm-cov nextest --lcov --output-path lcov.info
with the result of llvm-cov running doctests on its own.The text was updated successfully, but these errors were encountered: