From bb0be18de31f30d8d31e44d4ac69a048f2b750a7 Mon Sep 17 00:00:00 2001 From: Chun-Min Chang Date: Tue, 18 Feb 2020 14:48:18 -0800 Subject: [PATCH 1/3] Run the tests in the sub crate --- run_tests.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/run_tests.sh b/run_tests.sh index dacde7cf..085e4d3b 100644 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,6 +1,14 @@ # display backtrace for debugging export RUST_BACKTRACE=1 +# Run tests in the sub crate +# ------------------------------------------------------------------------------------------------- +cd coreaudio-sys-utils +cargo test +cd .. + +# Run tests in the main crate +# ------------------------------------------------------------------------------------------------- # Regular Tests cargo test --verbose cargo test test_configure_output -- --ignored From 2758f8b041c6bada3e8e5bb2f44349ae569101dd Mon Sep 17 00:00:00 2001 From: Chun-Min Chang Date: Tue, 18 Feb 2020 15:11:06 -0800 Subject: [PATCH 2/3] Run tests in sub crate by the sanitizers --- run_sanitizers.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/run_sanitizers.sh b/run_sanitizers.sh index bd9c233c..dd7036ab 100644 --- a/run_sanitizers.sh +++ b/run_sanitizers.sh @@ -14,6 +14,26 @@ else exit fi +# Run tests in the sub crate +# ------------------------------------------------------------------------------------------------- +cd coreaudio-sys-utils + +echo "\n\nRun ASan\n-----------\n" +RUSTFLAGS="-Z sanitizer=address" cargo test + +echo "\n\nRun LSan\n-----------\n" +RUSTFLAGS="-Z sanitizer=leak" cargo test + +echo "\n\nRun MSan\n-----------\n" +RUSTFLAGS="-Z sanitizer=memory" cargo test + +echo "\n\nRun TSan\n-----------\n" +RUSTFLAGS="-Z sanitizer=thread" cargo test + +cd .. + +# Run tests in the main crate +# ------------------------------------------------------------------------------------------------- echo "\n\nRun ASan\n-----------\n" RUSTFLAGS="-Z sanitizer=address" sh run_tests.sh From fbad9918655466a37bd879039dd60005fb013ab3 Mon Sep 17 00:00:00 2001 From: Chun-Min Chang Date: Tue, 18 Feb 2020 15:16:07 -0800 Subject: [PATCH 3/3] Add format and lint(clippy) checks in run_tests.sh The format check should always be run, in main crate and sub crate, not only in Travis CI server only. The format checks and lints(clippy) checks should be moved from .travis.yml to run_tests.sh. --- .travis.yml | 2 -- run_tests.sh | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e7b826d..9fe1f38e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,6 @@ before_script: - cargo --version - sh install_rustfmt_clippy.sh script: - - cargo fmt --all -- --check - - cargo clippy -- -D warnings - cargo build --verbose - sh run_tests.sh - sh run_sanitizers.sh diff --git a/run_tests.sh b/run_tests.sh index 085e4d3b..8854ebab 100644 --- a/run_tests.sh +++ b/run_tests.sh @@ -4,11 +4,26 @@ export RUST_BACKTRACE=1 # Run tests in the sub crate # ------------------------------------------------------------------------------------------------- cd coreaudio-sys-utils + +# Format check +cargo fmt --all -- --check + +# Lints check +cargo clippy -- -D warnings + +# Regular Tests cargo test + cd .. # Run tests in the main crate # ------------------------------------------------------------------------------------------------- +# Format check +cargo fmt --all -- --check + +# Lints check +cargo clippy -- -D warnings + # Regular Tests cargo test --verbose cargo test test_configure_output -- --ignored