You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #79818 - richkadel:llvm-coverage-counters-2.1.0, r=tmandry
Fixes to Rust coverage
Fixes: #79725
Some macros can create a situation where `fn_sig_span` and `body_span`
map to different files.
New documentation on coverage tests incorrectly assumed multiple test
binaries could just be listed at the end of the `llvm-cov` command,
but it turns out each binary needs a `--object` prefix.
This PR fixes the bug and updates the documentation to correct that
issue. It also fixes a few other minor issues in internal implementation
comments, and adds documentation on getting coverage results for doc
tests.
--instr-profile=json5format.profdata --summary-only # and/or other options
294
+
```
295
+
296
+
Note, the differences in this `cargo cov` command, compared with the version without
297
+
doc tests, include:
298
+
299
+
* The `cargo test ... --no-run` command is updated with the same environment variables
300
+
and flags used to _build_ the tests, _including_ the doc tests. (`LLVM_PROFILE_FILE`
301
+
is only used when _running_ the tests.)
302
+
* The file glob pattern `target/debug/doctestbins/*/rust_out` adds the `rust_out`
303
+
binaries generated for doc tests (note, however, that some `rust_out` files may not
304
+
be executable binaries).
305
+
*`[[ -x $file ]] &&` filters the files passed on to the `printf`, to include only
306
+
executable binaries.
307
+
308
+
[^79417]: There is ongoing work to resolve a known issue
309
+
[(#79417)](https://github.com/rust-lang/rust/issues/79417) that doc test coverage
310
+
generates incorrect source line numbers in `llvm-cov show` results.
311
+
229
312
## Other references
230
313
231
314
Rust's implementation and workflow for source-based code coverage is based on the same library and tools used to implement [source-based code coverage in Clang]. (This document is partially based on the Clang guide.)
Emitting segments for function: _RINvCsbDqzXfLQacH_10used_crate41used_only_from_bin_crate_generic_functionRINtNtCsFAjihUSTht_5alloc3vec3VeclEECs4fqI2P2rA04_10uses_crate
81
+
Emitting segments for function: _RINvCsbDqzXfLQacH_10used_crate41used_only_from_bin_crate_generic_functionReECs4fqI2P2rA04_10uses_crate
82
82
Combined regions:
83
83
17:1 -> 19:2 (count=1)
84
84
Segment at 17:1 (count = 1), RegionEntry
85
85
Segment at 19:2 (count = 0), Skipped
86
-
Emitting segments for function: _RINvCsbDqzXfLQacH_10used_crate41used_only_from_bin_crate_generic_functionReECs4fqI2P2rA04_10uses_crate
86
+
Emitting segments for function: _RINvCsbDqzXfLQacH_10used_crate41used_only_from_bin_crate_generic_functionRINtNtCs3QflaznQylx_5alloc3vec3VeclEECs4fqI2P2rA04_10uses_crate
87
87
Combined regions:
88
88
17:1 -> 19:2 (count=1)
89
89
Segment at 17:1 (count = 1), RegionEntry
90
90
Segment at 19:2 (count = 0), Skipped
91
-
Emitting segments for function: _RINvCsbDqzXfLQacH_10used_crate46used_only_from_this_lib_crate_generic_functionINtNtCsFAjihUSTht_5alloc3vec3VeclEEB2_
91
+
Emitting segments for function: _RINvCsbDqzXfLQacH_10used_crate46used_only_from_this_lib_crate_generic_functionINtNtCs3QflaznQylx_5alloc3vec3VeclEEB2_
92
92
Combined regions:
93
93
21:1 -> 23:2 (count=1)
94
94
Segment at 21:1 (count = 1), RegionEntry
@@ -98,7 +98,7 @@ Combined regions:
98
98
21:1 -> 23:2 (count=1)
99
99
Segment at 21:1 (count = 1), RegionEntry
100
100
Segment at 23:2 (count = 0), Skipped
101
-
Emitting segments for function: _RINvCsbDqzXfLQacH_10used_crate50used_from_bin_crate_and_lib_crate_generic_functionINtNtCsFAjihUSTht_5alloc3vec3VeclEECs4fqI2P2rA04_10uses_crate
101
+
Emitting segments for function: _RINvCsbDqzXfLQacH_10used_crate50used_from_bin_crate_and_lib_crate_generic_functionINtNtCs3QflaznQylx_5alloc3vec3VeclEECs4fqI2P2rA04_10uses_crate
0 commit comments