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