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

grcov get more excute times #1151

Open
yuhui518 opened this issue Dec 11, 2023 · 1 comment
Open

grcov get more excute times #1151

yuhui518 opened this issue Dec 11, 2023 · 1 comment

Comments

@yuhui518
Copy link

yuhui518 commented Dec 11, 2023

1.cargo new hello_world
2.RUSTFLAGS="-C instrument-coverage" cargo cuild
3.cd target/debug && ./hello_world
4. grcov ./target/debug --binary-path ./target/debug -s . -t html --ignore-not-existing -o ../cov/
then,the result is:
image
image

Next, I use the llvm-cov tool to get the same profraw file's code covrage,the result is:
image
image

I just only excute the "hello_world" binary one times, the grcov's result is three times, and the llvm-cov's result is correct.

Tasks

Preview Give feedback
No tasks being tracked yet.
@yuhui518
Copy link
Author

The llvm-cov's command is:
1.cd target/debug
2.llvm-profdata merge -sparse *.profraw -o json5format.profdata
3.cd ../..
4.. llvm-cov report
--use-color --ignore-filename-regex='/.cargo/registry'
--instr-profile=target/debug/json5format.profdata
--object target/debug/hello_world
5. llvm-cov show
--use-color --ignore-filename-regex='/.cargo/registry'
--instr-profile=target/debug/json5format.profdata
--object target/debug/hello_world
--show-instantiations --show-line-counts-or-regions

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