test_full.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. set -ex
  3. echo Testing num on rustc ${TRAVIS_RUST_VERSION}
  4. # All of these packages should build and test everywhere.
  5. for package in bigint complex integer iter rational traits; do
  6. if [ "$TRAVIS_RUST_VERSION" = 1.8.0 ]; then
  7. # libc 0.2.34 started using #[deprecated]
  8. cargo generate-lockfile --manifest-path $package/Cargo.toml
  9. cargo update --manifest-path $package/Cargo.toml --package libc --precise 0.2.33 || :
  10. fi
  11. cargo build --manifest-path $package/Cargo.toml
  12. cargo test --manifest-path $package/Cargo.toml
  13. done
  14. # They all should build with minimal features too
  15. for package in bigint complex integer iter rational traits; do
  16. cargo build --manifest-path $package/Cargo.toml --no-default-features
  17. cargo test --manifest-path $package/Cargo.toml --no-default-features
  18. done
  19. # Each isolated feature should also work everywhere.
  20. for feature in '' bigint rational complex; do
  21. cargo build --verbose --no-default-features --features="$feature"
  22. cargo test --verbose --no-default-features --features="$feature"
  23. done
  24. # Build test for the serde feature
  25. cargo build --verbose --features "serde"
  26. # Downgrade serde and build test the 0.7.0 channel as well
  27. cargo update -p serde --precise 0.7.0
  28. cargo build --verbose --features "serde"
  29. if [ "$TRAVIS_RUST_VERSION" = 1.8.0 ]; then exit; fi
  30. # num-derive should build on 1.15.0+
  31. cargo build --verbose --manifest-path=derive/Cargo.toml
  32. if [ "$TRAVIS_RUST_VERSION" != nightly ]; then exit; fi
  33. # num-derive testing requires compiletest_rs, which requires nightly
  34. cargo test --verbose --manifest-path=derive/Cargo.toml
  35. # benchmarks only work on nightly
  36. cargo bench --verbose