From 20ec96146a10448793cfcd34c0f7ee2af333ff36 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 13 Jan 2020 22:42:48 -0800 Subject: [PATCH] Move quickcheck_macros to ci/big_quickcheck --- Cargo.toml | 5 ----- ci/big_quickcheck/Cargo.toml | 14 ++++++++++++++ .../quickcheck.rs => ci/big_quickcheck/src/lib.rs | 9 +++++++-- ci/test_full.sh | 3 ++- 4 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 ci/big_quickcheck/Cargo.toml rename tests/quickcheck.rs => ci/big_quickcheck/src/lib.rs (97%) diff --git a/Cargo.toml b/Cargo.toml index 24c3f2fb..d55fb71f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,11 +59,6 @@ optional = true version = "0.9" default-features = false -[dependencies.quickcheck_macros] -optional = true -version = "0.9" -default-features = false - [features] default = ["std"] std = ["num-integer/std", "num-traits/std"] diff --git a/ci/big_quickcheck/Cargo.toml b/ci/big_quickcheck/Cargo.toml new file mode 100644 index 00000000..a39c266d --- /dev/null +++ b/ci/big_quickcheck/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "big_quickcheck" +version = "0.1.0" +authors = ["Josh Stone "] + +[dependencies] +num-integer = "0.1.42" +num-traits = "0.2.11" +quickcheck = "0.9" +quickcheck_macros = "0.9" + +[dependencies.num-bigint] +features = ["quickcheck"] +path = "../.." diff --git a/tests/quickcheck.rs b/ci/big_quickcheck/src/lib.rs similarity index 97% rename from tests/quickcheck.rs rename to ci/big_quickcheck/src/lib.rs index a9e7b04b..8eacd1a5 100644 --- a/tests/quickcheck.rs +++ b/ci/big_quickcheck/src/lib.rs @@ -1,5 +1,10 @@ -#![cfg(feature = "quickcheck")] -#![cfg(feature = "quickcheck_macros")] +//! Quickcheck of `BigUint` and `BigInt` +//! +//! This test is in a completely separate crate so we can use `quickcheck_macros` only when +//! `quickcheck` is active. The main crate can't have optional dev-dependencies, and it's +//! better not to expose it as a "feature" optional dependency. + +#![cfg(test)] extern crate num_bigint; extern crate num_integer; diff --git a/ci/test_full.sh b/ci/test_full.sh index 4981b32d..37505bd2 100755 --- a/ci/test_full.sh +++ b/ci/test_full.sh @@ -7,7 +7,7 @@ echo Testing num-bigint on rustc ${TRAVIS_RUST_VERSION} case "$TRAVIS_RUST_VERSION" in 1.31.*) STD_FEATURES="serde" ;; 1.3[23].*) STD_FEATURES="serde rand" ;; - *) STD_FEATURES="serde rand quickcheck quickcheck_macros" ;; + *) STD_FEATURES="serde rand quickcheck" ;; esac case "$TRAVIS_RUST_VERSION" in @@ -57,4 +57,5 @@ fi case "$STD_FEATURES" in *serde*) cargo test --manifest-path ci/big_serde/Cargo.toml ;;& *rand*) cargo test --manifest-path ci/big_rand/Cargo.toml ;;& + *quickcheck*) cargo test --manifest-path ci/big_quickcheck/Cargo.toml ;;& esac