Skip to content

Commit 8e5ffb4

Browse files
feat: rename instrumentation to simulation
`instrumentation` is still accepted as an input, but it maps to simulation internally, as we plan to phase it out.
1 parent 03f528f commit 8e5ffb4

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

crates/cargo-codspeed/src/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ See `cargo codspeed build --help` for more information.");
225225
"-Cstrip=none".to_owned(),
226226
];
227227

228-
// Add the codspeed cfg flag if instrumentation mode is enabled
229-
if measurement_mode == MeasurementMode::Instrumentation {
228+
// Add the codspeed cfg flag if simulation mode is enabled
229+
if measurement_mode == MeasurementMode::Simulation {
230230
flags.push("--cfg=codspeed".to_owned());
231231
}
232232

crates/cargo-codspeed/src/measurement_mode.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use std::fmt;
66
#[serde(rename_all = "lowercase")]
77
pub enum MeasurementMode {
88
#[default]
9-
Instrumentation,
9+
#[value(alias = "instrumentation")]
10+
Simulation,
1011
Walltime,
1112
}
1213

@@ -16,7 +17,7 @@ impl fmt::Display for MeasurementMode {
1617
f,
1718
"{}",
1819
match self {
19-
MeasurementMode::Instrumentation => "instrumentation",
20+
MeasurementMode::Simulation => "simulation",
2021
MeasurementMode::Walltime => "walltime",
2122
}
2223
)

crates/cargo-codspeed/tests/simple-bencher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn test_simple_run_without_build() {
1313
.arg("run")
1414
.assert()
1515
.failure()
16-
.stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first."));
16+
.stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first."));
1717
teardown(dir);
1818
}
1919

crates/cargo-codspeed/tests/simple-criterion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn test_criterion_run_without_build() {
1515
.arg("run")
1616
.assert()
1717
.failure()
18-
.stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first."));
18+
.stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first."));
1919
teardown(dir);
2020
}
2121

crates/cargo-codspeed/tests/simple-divan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn test_divan_run_without_build() {
1515
.arg("run")
1616
.assert()
1717
.failure()
18-
.stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first."));
18+
.stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first."));
1919
teardown(dir);
2020
}
2121

crates/cargo-codspeed/tests/workspace.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn test_workspace_run_without_build() {
1212
.arg("run")
1313
.assert()
1414
.failure()
15-
.stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first."));
15+
.stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first."));
1616
teardown(dir);
1717
}
1818

@@ -62,7 +62,7 @@ fn test_workspace_build_subpackage_and_run_other() {
6262
.args(["--package", "package-b"])
6363
.assert()
6464
.failure()
65-
.stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first."));
65+
.stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first."));
6666
teardown(dir);
6767
}
6868

0 commit comments

Comments
 (0)