Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uncover reports on #[cfg_attr] #1012

Open
kazuk opened this issue Apr 10, 2023 · 0 comments
Open

uncover reports on #[cfg_attr] #1012

kazuk opened this issue Apr 10, 2023 · 0 comments

Comments

@kazuk
Copy link
Contributor

kazuk commented Apr 10, 2023

We are measuring coverage using grcov.

We provide tracing as an optional feature, so we use #[cfg_attr(feature="trace", instrument)] to instrument when the trace feature is enabled.

When we collect coverage information using grcov, the cfg_attr line is reported as unexecuted lines.

Similarly, specifying traced_test for trace using #[cfg_attr(feature = "trace", traced_test)] is also reported as unexecuted.

We want to avoid reporting attribute settings as unexecuted.

Here are the test environment and compile options:

Environment:

kazuk@kazuk-ryzen5800x:~/parse-it$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/kazuk/.rustup

installed toolchains
--------------------

stable-aarch64-unknown-linux-gnu
stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

aarch64-unknown-linux-gnu
aarch64-unknown-linux-musl
wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.68.2 (9eb3afe9e 2023-03-27)

kazuk@kazuk-ryzen5800x:~/parse-it$ grcov --version
grcov 0.8.16

Compiler options:

  "RUSTFLAGS"= "-Cinstrument-coverage -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"

grcov options:

grcov ${COVERAGE_PROF_OUTPUT} \
  -b ${COVERAGE_BINARIES} -s ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY} \
  -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/lcov.info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant