Skip to content

Commit

Permalink
Move rand benches to their own crate
Browse files Browse the repository at this point in the history
  • Loading branch information
vks committed Apr 26, 2024
1 parent d507f7e commit 6f917e1
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
run: |
cargo test --target ${{ matrix.target }} --features=nightly
cargo test --target ${{ matrix.target }} --all-features
cargo test --target ${{ matrix.target }} --benches --features=small_rng,nightly
cargo test --target ${{ matrix.target }} --manifest-path rand_benches/Cargo.toml --benches --features=small_rng,nightly
cargo test --target ${{ matrix.target }} --manifest-path rand_distr/Cargo.toml --benches
cargo test --target ${{ matrix.target }} --lib --tests --no-default-features
- name: Test rand
Expand Down
22 changes: 1 addition & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ unbiased = []

[workspace]
members = [
"rand_benches",
"rand_core",
"rand_distr",
"rand_chacha",
Expand All @@ -76,24 +77,3 @@ rand_pcg = { path = "rand_pcg", version = "=0.9.0-alpha.1" }
# Only to test serde1
bincode = "1.2.1"
rayon = "1.5.3"
criterion = "0.5"

[[bench]]
name = "uniform"
path = "benches/uniform.rs"
harness = false

[[bench]]
name = "seq_choose"
path = "benches/seq_choose.rs"
harness = false

[[bench]]
name = "shuffle"
path = "benches/shuffle.rs"
harness = false

[[bench]]
name = "uniform_float"
path = "benches/uniform_float.rs"
harness = false
32 changes: 32 additions & 0 deletions rand_benches/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "rand_benches"
version = "0.1.0"
edition = "2021"

[dependencies]

[dev-dependencies]
rand = { path = "..", features = ["small_rng", "nightly"] }
rand_pcg = { path = "../rand_pcg" }
rand_chacha = { path = "../rand_chacha" }
criterion = "0.5"

[[bench]]
name = "uniform"
path = "benches/uniform.rs"
harness = false

[[bench]]
name = "seq_choose"
path = "benches/seq_choose.rs"
harness = false

[[bench]]
name = "shuffle"
path = "benches/shuffle.rs"
harness = false

[[bench]]
name = "uniform_float"
path = "benches/uniform_float.rs"
harness = false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions rand_benches/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Please use `cargo bench` to run the benchmarks instead.");
}

0 comments on commit 6f917e1

Please sign in to comment.