yshavit / mdq

like jq but for Markdown: find specific elements in a md doc
Apache License 2.0
5 stars 0 forks source link

code coverage is inflated #126

Closed yshavit closed 2 months ago

yshavit commented 2 months ago

My coverage tool is including tests, which is cheating!

I found a mention of a fix: https://github.com/taiki-e/cargo-llvm-cov?tab=readme-ov-file#exclude-function-from-coverage

If you want to ignore all #[test]-related code, consider using coverage-helper crate version 0.2+.

But I couldn't get it to work.

yshavit commented 2 months ago

I could also use https://github.com/xd009642/tarpaulin

$ sudo apt-get install libssl-dev
$ cargo binstall cargo-tarpaulin
$ cargo tarpaulin -o json --output-dir target/
$ cat target/tarpaulin-report.json | jq .coverage

Note that these tests run significantly slower than the normal cargo test, so the variants checkers would need to be given a bit more time.