This commit is contained in:
David Peter committed 2026-10-06 12:54:39 +02:00
1 parent 55dfe6722c
commit a027c1eb22
21 files changed
+346 -154

No files matched your search

+2 -1
View File
@@ -55,7 +55,7 @@ fn runs_successfully() {
#[test]
fn metric_presets_select_available_metrics() {
for preset in ["speed", "all"] {
for preset in ["time", "all"] {
let output = hyperfine_debug()
.arg(format!("--metrics={preset}"))
.args(["--style=basic", "--runs=2", "sleep 1", "sleep 2"])
@@ -64,6 +64,7 @@ fn metric_presets_select_available_metrics() {
assert!(output.status.success(), "{:?}", output);
let stdout = String::from_utf8(output.stdout).unwrap();
assert_eq!(stdout.matches("Wall Time").count(), 2);
assert_eq!(stdout.matches("CPU time").count(), 2);
assert_eq!(stdout.matches("User time").count(), 2);
assert_eq!(stdout.matches("System time").count(), 2);
assert_eq!(stdout.contains("Memory"), preset == "all" && !cfg!(windows));
@@ -50,7 +50,11 @@ exit_code: 0
"value": 0.0,
"unit": "byte"
},
"exit_code": 0
"exit_code": 0,
"time_cpu": {
"value": 0.0,
"unit": "second"
}
},
{
"time_wall_clock": {
@@ -69,7 +73,11 @@ exit_code: 0
"value": 0.0,
"unit": "byte"
},
"exit_code": 0
"exit_code": 0,
"time_cpu": {
"value": 0.0,
"unit": "second"
}
}
],
"summary": {
@@ -82,6 +90,15 @@ exit_code: 0
"min": 0.0,
"max": 0.0
},
"time_cpu": {
"unit": "second",
"count": 2,
"mean": 0.0,
"stddev": 0.0,
"median": 0.0,
"min": 0.0,
"max": 0.0
},
"time_system": {
"unit": "second",
"count": 2,
@@ -131,7 +148,11 @@ exit_code: 0
"value": 0.0,
"unit": "byte"
},
"exit_code": 0
"exit_code": 0,
"time_cpu": {
"value": 0.0,
"unit": "second"
}
},
{
"time_wall_clock": {
@@ -150,7 +171,11 @@ exit_code: 0
"value": 0.0,
"unit": "byte"
},
"exit_code": 0
"exit_code": 0,
"time_cpu": {
"value": 0.0,
"unit": "second"
}
}
],
"summary": {
@@ -163,6 +188,15 @@ exit_code: 0
"min": 0.0,
"max": 0.0
},
"time_cpu": {
"unit": "second",
"count": 2,
"mean": 0.0,
"stddev": 0.0,
"median": 0.0,
"min": 0.0,
"max": 0.0
},
"time_system": {
"unit": "second",
"count": 2,
@@ -50,7 +50,11 @@ exit_code: 0
"value": 0.0,
"unit": "byte"
},
"exit_code": 0
"exit_code": 0,
"time_cpu": {
"value": 0.0,
"unit": "second"
}
},
{
"time_wall_clock": {
@@ -69,7 +73,11 @@ exit_code: 0
"value": 0.0,
"unit": "byte"
},
"exit_code": 0
"exit_code": 0,
"time_cpu": {
"value": 0.0,
"unit": "second"
}
}
],
"parameters": {
@@ -87,6 +95,15 @@ exit_code: 0
"min": 0.0,
"max": 0.0
},
"time_cpu": {
"unit": "second",
"count": 2,
"mean": 0.0,
"stddev": 0.0,
"median": 0.0,
"min": 0.0,
"max": 0.0
},
"time_system": {
"unit": "second",
"count": 2,
@@ -137,7 +154,11 @@ exit_code: 0
"value": 0.0,
"unit": "byte"
},
"exit_code": 0
"exit_code": 0,
"time_cpu": {
"value": 0.0,
"unit": "second"
}
},
{
"time_wall_clock": {
@@ -156,7 +177,11 @@ exit_code: 0
"value": 0.0,
"unit": "byte"
},
"exit_code": 0
"exit_code": 0,
"time_cpu": {
"value": 0.0,
"unit": "second"
}
}
],
"parameters": {
@@ -174,6 +199,15 @@ exit_code: 0
"min": 0.0,
"max": 0.0
},
"time_cpu": {
"unit": "second",
"count": 2,
"mean": 0.0,
"stddev": 0.0,
"median": 0.0,
"min": 0.0,
"max": 0.0
},
"time_system": {
"unit": "second",
"count": 2,
@@ -45,7 +45,11 @@ exit_code: 0
"value": 0.0,
"unit": "byte"
},
"exit_code": 0
"exit_code": 0,
"time_cpu": {
"value": 0.0,
"unit": "second"
}
}
],
"summary": {
@@ -58,6 +62,15 @@ exit_code: 0
"min": 0.0,
"max": 0.0
},
"time_cpu": {
"unit": "second",
"count": 1,
"mean": 0.0,
"stddev": null,
"median": 0.0,
"min": 0.0,
"max": 0.0
},
"time_system": {
"unit": "second",
"count": 1,