2020-04-11 23:14:41 +03:00
|
|
|
# Bail out once getting an error.
|
2020-04-06 15:43:21 +03:00
|
|
|
set -e
|
|
|
|
|
2020-03-20 19:41:27 +03:00
|
|
|
echo "\n\nTest suite for cubeb-coreaudio\n========================================"
|
|
|
|
|
|
|
|
if [[ -z "${RUST_BACKTRACE}" ]]; then
|
2020-04-06 15:43:21 +03:00
|
|
|
# Display backtrace for debugging
|
|
|
|
export RUST_BACKTRACE=1
|
2020-03-20 19:41:27 +03:00
|
|
|
fi
|
|
|
|
echo "RUST_BACKTRACE is set to ${RUST_BACKTRACE}\n"
|
2019-12-11 23:57:35 +03:00
|
|
|
|
2020-02-26 18:25:36 +03:00
|
|
|
# Run tests in the sub crate
|
2020-03-20 19:41:27 +03:00
|
|
|
# Run the tests by `cargo * -p <SUB_CRATE>` if it's possible. By doing so, the duplicate compiling
|
|
|
|
# between this crate and the <SUB_CRATE> can be saved. The compiling for <SUB_CRATE> can be reused
|
|
|
|
# when running `cargo *` with this crate.
|
2020-02-26 18:25:36 +03:00
|
|
|
# -------------------------------------------------------------------------------------------------
|
2020-03-20 19:41:27 +03:00
|
|
|
SUB_CRATE="coreaudio-sys-utils"
|
2020-02-26 18:25:36 +03:00
|
|
|
|
|
|
|
# Format check
|
2020-03-20 19:41:27 +03:00
|
|
|
# `cargo fmt -p *` is only usable in workspaces, so a workaround is to enter to the sub crate
|
|
|
|
# and then exit from it.
|
|
|
|
cd $SUB_CRATE
|
2020-04-11 23:14:41 +03:00
|
|
|
cargo fmt --all -- --check
|
2020-03-20 19:41:27 +03:00
|
|
|
cd ..
|
2020-02-26 18:25:36 +03:00
|
|
|
|
|
|
|
# Lints check
|
2020-04-11 23:14:41 +03:00
|
|
|
cargo clippy -p $SUB_CRATE -- -D warnings
|
2020-02-26 18:25:36 +03:00
|
|
|
|
|
|
|
# Regular Tests
|
2020-03-20 19:41:27 +03:00
|
|
|
cargo test -p $SUB_CRATE
|
2020-02-26 18:25:36 +03:00
|
|
|
|
|
|
|
# Run tests in the main crate
|
|
|
|
# -------------------------------------------------------------------------------------------------
|
|
|
|
# Format check
|
2020-04-11 23:14:41 +03:00
|
|
|
cargo fmt --all -- --check
|
2020-02-26 18:25:36 +03:00
|
|
|
|
|
|
|
# Lints check
|
2020-04-11 23:14:41 +03:00
|
|
|
cargo clippy -- -D warnings
|
2020-02-26 18:25:36 +03:00
|
|
|
|
2019-12-10 18:43:17 +03:00
|
|
|
# Regular Tests
|
|
|
|
cargo test --verbose
|
|
|
|
cargo test test_configure_output -- --ignored
|
|
|
|
cargo test test_aggregate -- --ignored --test-threads=1
|
|
|
|
|
|
|
|
# Parallel Tests
|
|
|
|
cargo test test_parallel -- --ignored --nocapture --test-threads=1
|
|
|
|
|
|
|
|
# Device-changed Tests
|
2020-03-20 19:41:27 +03:00
|
|
|
sh run_device_tests.sh
|
2019-12-10 18:43:17 +03:00
|
|
|
|
|
|
|
# Manual Tests
|
|
|
|
# cargo test test_switch_output_device -- --ignored --nocapture
|
|
|
|
# cargo test test_device_collection_change -- --ignored --nocapture
|
2019-12-11 23:57:35 +03:00
|
|
|
# cargo test test_stream_tester -- --ignored --nocapture
|