-
Notifications
You must be signed in to change notification settings - Fork 15
/
ct.sh
executable file
·56 lines (47 loc) · 2.15 KB
/
ct.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
set -ex
cd "$(dirname "$0")"
cd "./mbedtls"
if [ -z $TRAVIS_RUST_VERSION ]; then
echo "Expected TRAVIS_RUST_VERSION to be set in env"
exit 1
fi
if [ "$TARGET" == "aarch64-unknown-linux-musl" ]; then
pushd /tmp && wget https://musl.cc/aarch64-linux-musl-cross.tgz;
tar -xzf aarch64-linux-musl-cross.tgz;
popd;
fi
export CFLAGS_x86_64_fortanix_unknown_sgx="-isystem/usr/include/x86_64-linux-gnu -mlvi-hardening -mllvm -x86-experimental-lvi-inline-asm-hardening"
export CC_x86_64_fortanix_unknown_sgx=clang-11
export CC_aarch64_unknown_linux_musl=/tmp/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=/tmp/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER=qemu-aarch64
if [ "$TRAVIS_RUST_VERSION" == "stable" ] || [ "$TRAVIS_RUST_VERSION" == "beta" ] || [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then
# Install the rust toolchain
rustup default $TRAVIS_RUST_VERSION
rustup target add --toolchain $TRAVIS_RUST_VERSION $TARGET
# The SGX target cannot be run under test like a ELF binary
if [ "$TARGET" != "x86_64-fortanix-unknown-sgx" ]; then
# make sure that explicitly providing the default target works
cargo test --target $TARGET --release
cargo test --features pkcs12 --target $TARGET
cargo test --features pkcs12_rc2 --target $TARGET
cargo test --features dsa --target $TARGET
# If zlib is installed, test the zlib feature
if [ -n "$ZLIB_INSTALLED" ]; then
cargo test --features zlib --target $TARGET
fi
# If AES-NI is supported, test the feature
if [ -n "$AES_NI_SUPPORT" ]; then
cargo test --features force_aesni_support --target $TARGET
fi
else
cargo +$TRAVIS_RUST_VERSION test --no-run --target=$TARGET
fi
elif [ $TRAVIS_RUST_VERSION = $CORE_IO_NIGHTLY ]; then
cargo +$CORE_IO_NIGHTLY test --no-default-features --features no_std_deps,rdrand,time
cargo +$CORE_IO_NIGHTLY test --no-default-features --features no_std_deps,rdrand
else
echo "Unknown version $TRAVIS_RUST_VERSION"
exit 1
fi