|
1 | | -#!/bin/sh |
| 1 | +#!/bin/bash |
2 | 2 | set -ex |
3 | 3 | cd "$(dirname "$0")" |
4 | 4 |
|
|
11 | 11 |
|
12 | 12 | if [ $TRAVIS_RUST_VERSION = "stable" ] || [ $TRAVIS_RUST_VERSION = "beta" ] || [ $TRAVIS_RUST_VERSION = "nightly" ]; then |
13 | 13 | rustup default $TRAVIS_RUST_VERSION |
14 | | - # make sure that explicitly providing the default target works |
15 | | - cargo test --target x86_64-unknown-linux-gnu |
16 | | - cargo test --release |
17 | | - cargo test --features spin_threading |
18 | | - cargo test --features rust_threading |
19 | | - cargo test --features custom_time,custom_gmtime_r |
20 | | - cargo test --features zlib |
21 | | - cargo test --features pkcs12 |
22 | | - cargo test --features pkcs12_rc2 |
23 | | - cargo test --features force_aesni_support |
24 | | - cargo test --features dsa |
25 | | - # without these, tests marked with tokio::test do not run, but report OK. |
26 | | - cargo test --features=std,threading,tokio,tokio/net,tokio/io-util,tokio/macros,tokio/rt |
| 14 | + rustup target add --toolchain $TRAVIS_RUST_VERSION $TARGET |
| 15 | + # The SGX target cannot be run under test like a ELF binary |
| 16 | + if [ "$TARGET" != "x86_64-fortanix-unknown-sgx" ]; then |
| 17 | + # make sure that explicitly providing the default target works |
| 18 | + cargo test --target $TARGET --release |
| 19 | + cargo test --features pkcs12 --target $TARGET |
| 20 | + cargo test --features pkcs12_rc2 --target $TARGET |
| 21 | + cargo test --features dsa --target $TARGET |
| 22 | + cargo test --features spin_threading --target $TARGET |
| 23 | + cargo test --features rust_threading --target $TARGET |
| 24 | + cargo test --features custom_time,custom_gmtime_r --target $TARGET |
| 25 | + # without these, tests marked with tokio::test do not run, but report OK. |
| 26 | + cargo test --features=std,threading,tokio,tokio/net,tokio/io-util,tokio/macros,tokio/rt --target $TARGET |
| 27 | + # If zlib is installed, test the zlib feature |
| 28 | + if [ -n "$ZLIB_INSTALLED" ]; then |
| 29 | + cargo test --features zlib --target $TARGET |
| 30 | + fi |
| 31 | + |
| 32 | + # If AES-NI is supported, test the feature |
| 33 | + if [ -n "$AES_NI_SUPPORT" ]; then |
| 34 | + cargo test --features force_aesni_support --target $TARGET |
| 35 | + fi |
| 36 | + else |
| 37 | + cargo +$TRAVIS_RUST_VERSION test --no-run --target=$TARGET |
| 38 | + fi |
27 | 39 |
|
28 | 40 | elif [ $TRAVIS_RUST_VERSION = $CORE_IO_NIGHTLY ]; then |
29 | 41 | cargo +$CORE_IO_NIGHTLY test --no-default-features --features core_io,rdrand,time,custom_time,custom_gmtime_r |
30 | 42 | cargo +$CORE_IO_NIGHTLY test --no-default-features --features core_io,rdrand |
31 | | - |
32 | | -elif [ $TRAVIS_RUST_VERSION = $SGX_NIGHTLY ]; then |
33 | | - rustup target add --toolchain $SGX_NIGHTLY x86_64-fortanix-unknown-sgx |
34 | | - cargo +$SGX_NIGHTLY test --no-run --target=x86_64-fortanix-unknown-sgx --features=sgx --no-default-features |
35 | | - |
36 | 43 | else |
37 | 44 | echo "Unknown version $TRAVIS_RUST_VERSION" |
38 | 45 | exit 1 |
|
0 commit comments