Commit d21e160
Tamas Vajk
Always instrument test targets for coverage
ctx.coverage_instrumented() returns False for test targets by design
(Bazel considers test sources not worth instrumenting). But Rust test
binaries statically link their dependencies, and the coverage runtime
only initializes if the binary itself is compiled with
-Cinstrument-coverage. Without this, test binaries produce no profraw
files and coverage collection fails with "no input files specified".
Always add -Cinstrument-coverage for test crates (crate_info.is_test)
when coverage is enabled, while still respecting the instrumentation
filter for library targets.1 parent 26d2d7e commit d21e160
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1223 | 1223 | | |
1224 | 1224 | | |
1225 | 1225 | | |
1226 | | - | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
1227 | 1230 | | |
1228 | 1231 | | |
1229 | 1232 | | |
| |||
0 commit comments