cloud-hypervisor/scripts/run_unit_tests.sh
Ruslan Mstoi 2b2d00653c scripts: fix shell scripts according to shellcheck errors
Unify coding style of shell scripts in accordance with
shellcheck errors.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2024-02-13 10:20:18 +00:00

22 lines
566 B
Bash
Executable File

#!/usr/bin/env bash
# shellcheck disable=SC2068
# shellcheck source=/dev/null
source "$HOME"/.cargo/env
source "$(dirname "$0")"/test-util.sh
process_common_args "$@"
cargo_args=("")
# shellcheck disable=SC2154
if [[ $hypervisor = "mshv" ]]; then
cargo_args+=("--features $hypervisor")
elif [[ $(uname -m) = "x86_64" ]]; then
cargo_args+=("--features tdx")
fi
export RUST_BACKTRACE=1
cargo test --lib --bins --target "$BUILD_TARGET" --workspace ${cargo_args[@]} || exit 1
cargo test --doc --target "$BUILD_TARGET" --workspace ${cargo_args[@]} || exit 1