Skip to content

Commit

Permalink
Rollup merge of #73142 - ehuss:std-benches, r=dtolnay
Browse files Browse the repository at this point in the history
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
  • Loading branch information
RalfJung authored Jun 19, 2020
2 parents 098949b + 5a9ff05 commit 78f3e9c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/liballoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ path = "../liballoc/tests/lib.rs"
[[bench]]
name = "collectionsbenches"
path = "../liballoc/benches/lib.rs"
test = true

[[bench]]
name = "vec_deque_append_bench"
Expand Down
1 change: 1 addition & 0 deletions src/libcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ path = "../libcore/tests/lib.rs"
[[bench]]
name = "corebenches"
path = "../libcore/benches/lib.rs"
test = true

[dev-dependencies]
rand = "0.7"
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/benches/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// wasm32 does not support benches (no time).
#![cfg(not(target_arch = "wasm32"))]
#![feature(flt2dec)]
#![feature(test)]

Expand Down
5 changes: 5 additions & 0 deletions src/libstd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@ std_detect_dlsym_getauxval = []
threads = 125
# Maximum heap size
heap_size = 0x8000000

[[bench]]
name = "stdbenches"
path = "benches/lib.rs"
test = true

0 comments on commit 78f3e9c

Please sign in to comment.