| 1 |
#!/usr/bin/env sh |
| 2 |
|
| 3 |
set -ex |
| 4 |
|
| 5 |
: "${TARGET?The TARGET environment variable must be set.}" |
| 6 |
: "${TRAVIS_RUST_VERSION?The TRAVIS_RUST_VERSION environment variable must be set.}" |
| 7 |
|
| 8 |
echo "Running tests for target: ${TARGET}" |
| 9 |
export RUST_BACKTRACE=1 |
| 10 |
export RUST_TEST_THREADS=1 |
| 11 |
export RUST_TEST_NOCAPTURE=1 |
| 12 |
export CARGO_INCREMENTAL=0 |
| 13 |
export CARGO_CODEGEN_UNITS=1 |
| 14 |
export RUSTFLAGS="-C codegen-units=1 " |
| 15 |
|
| 16 |
case "${TARGET}" in |
| 17 |
*"ios"*) |
| 18 |
export RUSTFLAGS="${RUSTFLAGS} -C link-args=-mios-simulator-version-min=7.0" |
| 19 |
rustc ./ci/deploy_and_run_on_ios_simulator.rs -o ios_cargo_runner --verbose |
| 20 |
if [ "${TARGET}" = "x86_64-apple-ios" ]; then |
| 21 |
export CARGO_TARGET_X86_64_APPLE_IOS_RUNNER |
| 22 |
CARGO_TARGET_X86_64_APPLE_IOS_RUNNER="$(pwd)/ios_cargo_runner" |
| 23 |
fi |
| 24 |
if [ "${TARGET}" = "i386-apple-ios" ]; then |
| 25 |
export CARGO_TARGET_I386_APPLE_IOS_RUNNER |
| 26 |
CARGO_TARGET_I386_APPLE_IOS_RUNNER="$(pwd)/ios_cargo_runner" |
| 27 |
fi |
| 28 |
;; |
| 29 |
*) |
| 30 |
;; |
| 31 |
esac |
| 32 |
|
| 33 |
# Build w/o std |
| 34 |
cargo clean |
| 35 |
cargo build --no-default-features --target "${TARGET}" -vv 2>&1 | tee build_no_std.txt |
| 36 |
|
| 37 |
# Check that the no-std builds are not linked against a libc with default |
| 38 |
# features or the std feature enabled: |
| 39 |
! grep -q "default" build_no_std.txt |
| 40 |
! grep -q "std" build_no_std.txt |
| 41 |
# Make sure that the resulting build contains no std symbols |
| 42 |
! find target/ -name "*.rlib" -exec nm {} \; | grep "std" |
| 43 |
|
| 44 |
# Runs mach's run-time tests: |
| 45 |
if [ -z "$NORUN" ]; then |
| 46 |
cargo test --target "${TARGET}" -vv |
| 47 |
cargo test --target "${TARGET}" -vv --features deprecated |
| 48 |
cargo test --no-default-features --target "${TARGET}" -vv |
| 49 |
fi |
| 50 |
|
| 51 |
# Runs ctest to verify mach's ABI against the system libraries: |
| 52 |
if [ -z "$NOCTEST" ]; then |
| 53 |
if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then |
| 54 |
cargo test --manifest-path mach-test/Cargo.toml --target "${TARGET}" -vv |
| 55 |
cargo test --no-default-features --manifest-path mach-test/Cargo.toml --target "${TARGET}" -vv |
| 56 |
fi |
| 57 |
fi |