2019-07-16 09:54:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source $HOME/.cargo/env
|
2022-03-28 11:09:02 +00:00
|
|
|
source $(dirname "$0")/test-util.sh
|
2020-11-18 00:37:27 +00:00
|
|
|
|
|
|
|
process_common_args "$@"
|
2019-07-16 09:54:33 +00:00
|
|
|
|
2020-04-21 06:02:58 +00:00
|
|
|
BUILD_TARGET=${BUILD_TARGET-x86_64-unknown-linux-gnu}
|
2020-11-18 00:37:27 +00:00
|
|
|
cargo_args=("")
|
2020-04-21 06:02:58 +00:00
|
|
|
|
2022-03-28 11:09:02 +00:00
|
|
|
if [[ $hypervisor = "mshv" ]]; then
|
2021-01-12 00:05:02 +00:00
|
|
|
cargo_args+=("--no-default-features")
|
2022-09-28 06:11:01 +00:00
|
|
|
cargo_args+=("--features $hypervisor")
|
2022-04-15 13:24:19 +00:00
|
|
|
elif [[ $(uname -m) = "x86_64" ]]; then
|
|
|
|
cargo_args+=("--features tdx")
|
2021-01-12 00:05:02 +00:00
|
|
|
fi
|
2022-03-02 12:05:35 +00:00
|
|
|
|
|
|
|
if [[ "${BUILD_TARGET}" == "aarch64-unknown-linux-musl" ]]; then
|
|
|
|
export TARGET_CC="musl-gcc"
|
|
|
|
export RUSTFLAGS="-C link-arg=-lgcc -C link_arg=-specs -C link_arg=/usr/lib/aarch64-linux-musl/musl-gcc.specs"
|
|
|
|
fi
|
|
|
|
|
2020-10-07 09:01:58 +00:00
|
|
|
export RUST_BACKTRACE=1
|
2022-03-28 11:09:02 +00:00
|
|
|
cargo test --lib --bins --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1
|
2023-04-05 01:01:51 +00:00
|
|
|
cargo test --doc --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1
|