diff --git a/crates/cargo-codspeed/src/run.rs b/crates/cargo-codspeed/src/run.rs index aaa4914b..1dc10393 100644 --- a/crates/cargo-codspeed/src/run.rs +++ b/crates/cargo-codspeed/src/run.rs @@ -108,7 +108,7 @@ pub fn run_benches( let benches = package_filters.benches_to_run(metadata, bench_target_filters, codspeed_target_dir)?; if benches.is_empty() { - bail!("No benchmarks found. Run `cargo codspeed build` first."); + bail!("No benchmarks found for the {measurement_mode} mode. Run `cargo codspeed build -m {measurement_mode}` first."); } eprintln!("Collected {} benchmark suite(s) to run", benches.len()); diff --git a/crates/cargo-codspeed/tests/simple-bencher.rs b/crates/cargo-codspeed/tests/simple-bencher.rs index e193c61e..d1643a05 100644 --- a/crates/cargo-codspeed/tests/simple-bencher.rs +++ b/crates/cargo-codspeed/tests/simple-bencher.rs @@ -13,7 +13,7 @@ fn test_simple_run_without_build() { .arg("run") .assert() .failure() - .stderr(contains("Error: No benchmarks found.")); + .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); teardown(dir); } diff --git a/crates/cargo-codspeed/tests/simple-criterion.rs b/crates/cargo-codspeed/tests/simple-criterion.rs index 35141b5f..3dc3e2e6 100644 --- a/crates/cargo-codspeed/tests/simple-criterion.rs +++ b/crates/cargo-codspeed/tests/simple-criterion.rs @@ -15,7 +15,7 @@ fn test_criterion_run_without_build() { .arg("run") .assert() .failure() - .stderr(contains("Error: No benchmarks found.")); + .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); teardown(dir); } diff --git a/crates/cargo-codspeed/tests/simple-divan.rs b/crates/cargo-codspeed/tests/simple-divan.rs index 057a5686..46a72fcd 100644 --- a/crates/cargo-codspeed/tests/simple-divan.rs +++ b/crates/cargo-codspeed/tests/simple-divan.rs @@ -15,7 +15,7 @@ fn test_divan_run_without_build() { .arg("run") .assert() .failure() - .stderr(contains("Error: No benchmarks found.")); + .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); teardown(dir); } diff --git a/crates/cargo-codspeed/tests/workspace.rs b/crates/cargo-codspeed/tests/workspace.rs index 337016e3..4bbae74e 100644 --- a/crates/cargo-codspeed/tests/workspace.rs +++ b/crates/cargo-codspeed/tests/workspace.rs @@ -12,7 +12,7 @@ fn test_workspace_run_without_build() { .arg("run") .assert() .failure() - .stderr(contains("Error: No benchmarks found.")); + .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); teardown(dir); } @@ -62,7 +62,7 @@ fn test_workspace_build_subpackage_and_run_other() { .args(["--package", "package-b"]) .assert() .failure() - .stderr(contains("Error: No benchmarks found.")); + .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); teardown(dir); }