Skip to content

Commit 78f3e9c

Browse files
authored
Rollup merge of #73142 - ehuss:std-benches, r=dtolnay
Ensure std benchmarks get tested. This ensures that the std benchmarks don't break in the future. Currently they aren't compiled or tested on CI, so they can easily bitrot. Testing a benchmark runs it with one iteration. Adding these should only add a few seconds to CI. Closes #54176 Closes #61913
2 parents 098949b + 5a9ff05 commit 78f3e9c

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

src/liballoc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ path = "../liballoc/tests/lib.rs"
2525
[[bench]]
2626
name = "collectionsbenches"
2727
path = "../liballoc/benches/lib.rs"
28+
test = true
2829

2930
[[bench]]
3031
name = "vec_deque_append_bench"

src/libcore/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ path = "../libcore/tests/lib.rs"
1919
[[bench]]
2020
name = "corebenches"
2121
path = "../libcore/benches/lib.rs"
22+
test = true
2223

2324
[dev-dependencies]
2425
rand = "0.7"

src/libcore/benches/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// wasm32 does not support benches (no time).
2+
#![cfg(not(target_arch = "wasm32"))]
13
#![feature(flt2dec)]
24
#![feature(test)]
35

src/libstd/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,8 @@ std_detect_dlsym_getauxval = []
7474
threads = 125
7575
# Maximum heap size
7676
heap_size = 0x8000000
77+
78+
[[bench]]
79+
name = "stdbenches"
80+
path = "benches/lib.rs"
81+
test = true

0 commit comments

Comments
 (0)