aboutsummaryrefslogtreecommitdiff
path: root/src/crates
diff options
context:
space:
mode:
Diffstat (limited to 'src/crates')
-rw-r--r--src/crates/candelabra/src/confirmation.rs17
1 files changed, 14 insertions, 3 deletions
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<HashMap<String, BenchmarkResult>> {
+ pub fn run_benchmarks(
+ &self,
+ proj: &Project,
+ baseline_name: &str,
+ ) -> Result<HashMap<String, BenchmarkResult>> {
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) {