diff options
Diffstat (limited to 'third_party/rust/num-bigint/ci')
-rwxr-xr-x | third_party/rust/num-bigint/ci/rustup.sh | 12 | ||||
-rwxr-xr-x | third_party/rust/num-bigint/ci/test_full.sh | 39 |
2 files changed, 51 insertions, 0 deletions
diff --git a/third_party/rust/num-bigint/ci/rustup.sh b/third_party/rust/num-bigint/ci/rustup.sh new file mode 100755 index 0000000000..c5aea794b5 --- /dev/null +++ b/third_party/rust/num-bigint/ci/rustup.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Use rustup to locally run the same suite of tests as .travis.yml. +# (You should first install/update all versions listed below.) + +set -ex + +export TRAVIS_RUST_VERSION +for TRAVIS_RUST_VERSION in 1.15.0 1.22.0 1.26.0 stable beta nightly; do + run="rustup run $TRAVIS_RUST_VERSION" + $run cargo build --verbose + $run $PWD/ci/test_full.sh +done diff --git a/third_party/rust/num-bigint/ci/test_full.sh b/third_party/rust/num-bigint/ci/test_full.sh new file mode 100755 index 0000000000..4e1b60e98a --- /dev/null +++ b/third_party/rust/num-bigint/ci/test_full.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +set -ex + +echo Testing num-bigint on rustc ${TRAVIS_RUST_VERSION} + +FEATURES="serde" +if [[ "$TRAVIS_RUST_VERSION" =~ ^(nightly|beta|stable|1.31.0|1.26.0|1.22.0)$ ]]; then + FEATURES="$FEATURES rand" +fi +if [[ "$TRAVIS_RUST_VERSION" =~ ^(nightly|beta|stable|1.31.0|1.26.0)$ ]]; then + FEATURES="$FEATURES i128" +fi +if [[ "$TRAVIS_RUST_VERSION" =~ ^(nightly|beta|stable|1.31.0)$ ]]; then + FEATURES="$FEATURES quickcheck quickcheck_macros" +fi + +# num-bigint should build and test everywhere. +cargo build --verbose +cargo test --verbose + +# It should build with minimal features too. +cargo build --no-default-features --features="std" +cargo test --no-default-features --features="std" + +# Each isolated feature should also work everywhere. +for feature in $FEATURES; do + cargo build --verbose --no-default-features --features="std $feature" + cargo test --verbose --no-default-features --features="std $feature" +done + +# test all supported features together +cargo build --features="std $FEATURES" +cargo test --features="std $FEATURES" + +# make sure benchmarks can be built +if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then + cargo bench --all-features --no-run +fi |