flamegraph-rs / flamegraph

Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3
Apache License 2.0
4.74k stars 144 forks source link

Correctly identify named unit test targets #242

Closed ramosbugs closed 1 year ago

ramosbugs commented 1 year ago

The --unit-test flag (with no argument) only works in crates with a single target. In crates with multiple targets, the flag results in a several possible targets found error. If a specific target name is passed as an argument to --unit-test, the tool always passes the --bin flag to Cargo, which fails for lib targets.

This PR changes the behavior when an argument is passed to --unit-test to resolve the name to the corresponding target in order to determine whether to pass the --lib or --bin flag to Cargo.

Fixes #211.

djc commented 1 year ago

Sorry -- add the comma, please?

djc commented 1 year ago

Thanks!