]>
git.proxmox.com Git - rustc.git/blob - src/test/run-make-fulldeps/coverage/coverage_tools.mk
1 # Common Makefile include for Rust `run-make-fulldeps/instrument-coverage-* tests. Include this
4 # -include ../instrument-coverage/coverage_tools.mk
6 # To enable the Rust compiler option `-C link-dead-code`, also set the following variable
7 # *BEFORE* the `-include` line:
17 # ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and
18 # `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`
19 # file, required for coverage reports.
21 # Enabling `-C link-dead-code` is preferred when compiling with `-Z instrument-coverage`, so
22 # `-C link-dead-code` is automatically enabled for all platform targets _except_ MSVC.
24 # Making the state of `-C link-dead-code` platform-dependent creates a problem for cross-platform
25 # tests because the injected counters, coverage reports, and some low-level output can be different,
26 # depending on the `-C link-dead-code` setting. For example, coverage reports will not report any
27 # coverage for a dead code region when the `-C link-dead-code` option is disabled, but with the
28 # option enabled, those same regions will show coverage counter values (of zero, of course).
30 # To ensure cross-platform `-Z instrument-coverage` generate consistent output, the
31 # `-C link-dead-code` option is always explicitly enabled or disabled.
33 # Since tests that execute binaries enabled with both `-Z instrument-coverage` and
34 # `-C link-dead-code` are known to fail, those tests will need the `# ignore-msvc` setting.
36 # If and when the above issue is resolved, the `# ignore-msvc` option can be removed, and the
37 # tests can be simplified to always test with `-C link-dead-code`.
39 UNAME
= $(shell uname
)
41 # FIXME(richkadel): Can any of the features tested by `run-make-fulldeps/coverage-*` tests be tested
42 # just as completely by more focused unit tests of the code logic itself, to reduce the number of
43 # test result files generated and maintained, and to help identify specific test failures and root