diff --git a/Cargo.toml b/Cargo.toml index 4a42706..2c471fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/ci/benchmarks/Cargo.toml b/ci/benchmarks/Cargo.toml new file mode 100644 index 0000000..88ab242 --- /dev/null +++ b/ci/benchmarks/Cargo.toml @@ -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 diff --git a/benches/bigrational.rs b/ci/benchmarks/src/main.rs similarity index 96% rename from benches/bigrational.rs rename to ci/benchmarks/src/main.rs index 2926337..37e7a42 100644 --- a/benches/bigrational.rs +++ b/ci/benchmarks/src/main.rs @@ -1,5 +1,4 @@ #![feature(test)] -#![cfg(feature = "rand")] extern crate test; diff --git a/benches/rng/mod.rs b/ci/benchmarks/src/rng.rs similarity index 100% rename from benches/rng/mod.rs rename to ci/benchmarks/src/rng.rs diff --git a/ci/test_full.sh b/ci/test_full.sh index 63525c1..ef92933 100755 --- a/ci/test_full.sh +++ b/ci/test_full.sh @@ -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