Skip to content

Commit

Permalink
Move benchmarks to a CI crate to hide rand
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Jun 23, 2022
1 parent 01941a8 commit 3d80360
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
8 changes: 0 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,8 @@ edition = "2018"
[package.metadata.docs.rs]
features = ["std", "num-bigint-std", "serde"]

[[bench]]
name = "bigrational"

[dependencies]

[dependencies.rand]
optional = true
version = "0.8"
default-features = false

[dependencies.num-bigint]
optional = true
version = "0.4.0"
Expand Down
21 changes: 21 additions & 0 deletions ci/benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "benchmarks"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

[dependencies.num-rational]
path = "../.."
default-features = false
features = ["num-bigint"]

[dependencies.num-bigint]
version = "0.4.0"
default-features = false

[dependencies.rand]
version = "0.8"
default-features = false
1 change: 0 additions & 1 deletion benches/bigrational.rs → ci/benchmarks/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(test)]
#![cfg(feature = "rand")]

extern crate test;

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions ci/test_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,8 @@ done
# test all supported features without std
cargo build --no-default-features --features="${NO_STD_FEATURES[*]}"
cargo test --no-default-features --features="${NO_STD_FEATURES[*]}"

# make sure benchmarks can be built and sanity-tested
if rustc --version | grep -q nightly; then
cargo test --manifest-path ci/benchmarks/Cargo.toml
fi

0 comments on commit 3d80360

Please sign in to comment.