kennytm / cargo-kcov

Cargo subcommand to run kcov to get coverage report on Linux
127 stars 20 forks source link

Coverage of integration tests in workspace #31

Closed fpoli closed 6 years ago

fpoli commented 6 years ago

Is there a way to run all integration tests of the subprojects of a workspace?

It seems that cargo kcov --all only runs unit tests by default, while cargo kcov --all --test <target> does not work because it tries to test <target> in each subproject (which fails because not all of them have <target>).

fpoli commented 6 years ago

I found the reason. cargo kcov --all runs all integration tests as expected, but in our case we don't see coverage on integration tests because in one of the first statements we invoke Rustc via rustc_driver, and from that point the coverage is zero. I suspect that kcov can not track the usage of a crate if it is not compiled in debug mode.