From ba31900cd8cf3f42b4bff28ca8f18849756158c9 Mon Sep 17 00:00:00 2001 From: Aria Shrimpton Date: Sat, 24 Feb 2024 17:06:26 +0000 Subject: save each confirmation benchmark as a different baseline --- src/crates/candelabra/src/confirmation.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/crates') diff --git a/src/crates/candelabra/src/confirmation.rs b/src/crates/candelabra/src/confirmation.rs index ad91280..c255628 100644 --- a/src/crates/candelabra/src/confirmation.rs +++ b/src/crates/candelabra/src/confirmation.rs @@ -31,15 +31,26 @@ impl State { self.save_choices(proj, selections) .context("error setting up project")?; - self.run_benchmarks(proj) + self.run_benchmarks(proj, &format!("{:?}", selections).replace("/", "-")) .context("error running benchmarks") } /// Run all benchmarks in the given project, returning their results. /// This can only parse criterion-formatted output - pub fn run_benchmarks(&self, proj: &Project) -> Result> { + pub fn run_benchmarks( + &self, + proj: &Project, + baseline_name: &str, + ) -> Result> { let child = Command::new("cargo") - .args(["bench"]) + .args([ + "bench", + "--bench", + "main", + "--", + "--save-baseline", + baseline_name, + ]) .current_dir(proj.source_dir.as_std_path()) .stdout(Stdio::piped()) .stderr(if log_enabled!(Level::Debug) { -- cgit v1.2.3