Check that the bench path exists before invoking analysis-stats

This commit is contained in:
Lukas Wirth 2023-09-03 10:03:20 +02:00
parent 3a6196bf9e
commit 520d02f561

View file

@ -97,6 +97,7 @@ impl Metrics {
name: &str, name: &str,
path: &str, path: &str,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
assert!(Path::new(path).exists(), "unable to find bench in {path}");
eprintln!("\nMeasuring analysis-stats/{name}"); eprintln!("\nMeasuring analysis-stats/{name}");
let output = cmd!(sh, "./target/release/rust-analyzer -q analysis-stats {path}").read()?; let output = cmd!(sh, "./target/release/rust-analyzer -q analysis-stats {path}").read()?;
for (metric, value, unit) in parse_metrics(&output) { for (metric, value, unit) in parse_metrics(&output) {