-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Output filenames for -Z instrument-coverage #79899
Comments
Since the file is generated by your own target binary (not from a Rust language tool), it's not something the compiler can easily work around. The default name |
@richkadel |
That's a good point. All of the work to-date has been on |
After playing more with the coverage stuff. I think it would be great if the coverage output could be placed next to the binary it was run with. For example if a test executable is at This is useful as the |
@vmx - Sounds good. I don't know if you'd be interested in working on this feature yourself, but I'd welcome the contribution. I'm not likely to have time to work on this myself due to shifting work priorities. If you can and want to submit a PR, please Thanks! |
Might be worth a comment in the document about this problem. I've had |
@rustbot label -requires-nightly (instrument-coverage has been stabilized) |
…le with profiling data. The different executables called by cargo test were fighting and replacing their recorded coverage data. See also rust-lang/rust#79899 for details. Also added tasks to delete any existing coverage data and reports to avoid conflicts with existing files.
I'm trying out the new
-Z instrument-coverage
support. One issue I ran into that by default the output is stored in a file calleddefault.profraw
. That file gets overridden on every new run.When running
cargo test
that is a problem. It runs several executables (e.g. for the library tests, integration tests doc tests), where each of them overrides thedefault.profraw
.I don't know if that is possible, but it would b great to have
.profraw
files named after the executable they were run with.Until then what you can do is running
cargo test
withLLVM_PROFILE_FILE
set to%m.profraw
:Which will then result in file names something like
52458732642933725367_0.profraw
, which can then be merged into a single indexed profile file viallvm-profdata merge -o default.profdata *.profraw
.The text was updated successfully, but these errors were encountered: