From 0a3ad6153a9d19a5d7258c8c9e9895d1af22b986 Mon Sep 17 00:00:00 2001 From: Songqian Li Date: Mon, 8 Jul 2024 21:21:01 +0800 Subject: [PATCH] scripts: add cargo test args for code coverage reports Add release and target params to `cargo test` since we collect the code coverage reports from `xx/$BUILD_TARGET/release/`. Signed-off-by: Songqian Li --- scripts/run_integration_tests_x86_64.sh | 4 ++-- scripts/run_unit_tests.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/run_integration_tests_x86_64.sh b/scripts/run_integration_tests_x86_64.sh index 27eb156a0..d7cbe0630 100755 --- a/scripts/run_integration_tests_x86_64.sh +++ b/scripts/run_integration_tests_x86_64.sh @@ -174,14 +174,14 @@ ulimit -l unlimited ulimit -n 4096 export RUST_BACKTRACE=1 -time cargo test $test_features "common_parallel::$test_filter" -- ${test_binary_args[*]} +time cargo test --release --target "$BUILD_TARGET" $test_features "common_parallel::$test_filter" -- ${test_binary_args[*]} RES=$? # Run some tests in sequence since the result could be affected by other tests # running in parallel. if [ $RES -eq 0 ]; then export RUST_BACKTRACE=1 - time cargo test $test_features "common_sequential::$test_filter" -- --test-threads=1 ${test_binary_args[*]} + time cargo test --release --target "$BUILD_TARGET" $test_features "common_sequential::$test_filter" -- --test-threads=1 ${test_binary_args[*]} RES=$? fi diff --git a/scripts/run_unit_tests.sh b/scripts/run_unit_tests.sh index ef8fd8cc2..3e300c44c 100755 --- a/scripts/run_unit_tests.sh +++ b/scripts/run_unit_tests.sh @@ -17,5 +17,5 @@ elif [[ $(uname -m) = "x86_64" ]]; then 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 +cargo test --lib --bins --target "$BUILD_TARGET" --release --workspace ${cargo_args[@]} || exit 1 +cargo test --doc --target "$BUILD_TARGET" --release --workspace ${cargo_args[@]} || exit 1