Skip to content

Commit

Permalink
Merge #121
Browse files Browse the repository at this point in the history
121: support rustc --manifest-path option r=djc a=eugene-babichenko

This is makes running `cargo flamegraph` for benchmarks from the workspace root very similar to `cargo bench`.

Co-authored-by: Yevhenii Babichenko <eugene.babichenko@protonmail.com>
  • Loading branch information
bors[bot] and eugene-babichenko authored Feb 16, 2021
2 parents 7ec0652 + 05d7dcd commit 9a152b2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bin/cargo-flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ struct Opt {
)]
bench: Option<String>,

/// Path to Cargo.toml
#[structopt(long = "manifest-path")]
manifest_path: Option<PathBuf>,

/// Output file, flamegraph.svg if not present
#[structopt(
parse(from_os_str),
Expand Down Expand Up @@ -144,6 +148,11 @@ fn build(opt: &Opt) {
cmd.arg(bench);
}

if let Some(ref manifest_path) = opt.manifest_path {
cmd.arg("--manifest-path");
cmd.arg(manifest_path);
}

if let Some(ref features) = opt.features {
cmd.arg("--features");
cmd.arg(features);
Expand Down

0 comments on commit 9a152b2

Please sign in to comment.