| #!/bin/bash |
| |
| set -ex |
| |
| echo Testing num on rustc ${TRAVIS_RUST_VERSION} |
| |
| FEATURES="serde" |
| if [[ "$TRAVIS_RUST_VERSION" =~ ^(nightly|beta|stable|1.26.0|1.22.0)$ ]]; then |
| FEATURES="$FEATURES rand" |
| fi |
| if [[ "$TRAVIS_RUST_VERSION" =~ ^(nightly|beta|stable|1.26.0)$ ]]; then |
| FEATURES="$FEATURES i128" |
| fi |
| |
| # num should build and test everywhere. |
| cargo build --verbose |
| cargo test --verbose |
| |
| # It should build with minimal features too. |
| cargo build --no-default-features |
| cargo test --no-default-features |
| |
| # Each isolated feature should also work everywhere. |
| # (but still with "std", else bigint breaks) |
| 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" |