Debian Codegraph @

third_party/rust/cubeb-coreaudio/run_tests.sh

raw
1 # Bail out once getting an error.
2 set -e
3
4 echo "\n\nTest suite for cubeb-coreaudio\n========================================"
5
6 if [[ -z "${RUST_BACKTRACE}" ]]; then
7 # Display backtrace for debugging
8 export RUST_BACKTRACE=1
9 fi
10 echo "RUST_BACKTRACE is set to ${RUST_BACKTRACE}\n"
11
12 # Run tests in the sub crate
13 # Run the tests by `cargo * -p <SUB_CRATE>` if it's possible. By doing so, the duplicate compiling
14 # between this crate and the <SUB_CRATE> can be saved. The compiling for <SUB_CRATE> can be reused
15 # when running `cargo *` with this crate.
16 # -------------------------------------------------------------------------------------------------
17 SUB_CRATE="coreaudio-sys-utils"
18
19 # Format check
20 # `cargo fmt -p *` is only usable in workspaces, so a workaround is to enter to the sub crate
21 # and then exit from it.
22 cd $SUB_CRATE
23 cargo fmt --all -- --check
24 cd ..
25
26 # Lints check
27 cargo clippy -p $SUB_CRATE -- -D warnings
28
29 # Regular Tests
30 cargo test -p $SUB_CRATE
31
32 # Run tests in the main crate
33 # -------------------------------------------------------------------------------------------------
34 # Format check
35 cargo fmt --all -- --check
36
37 # Lints check
38 cargo clippy -- -D warnings
39
40 # Regular Tests
41 cargo test --verbose
42
43 # Timing sensitive tests must run serially so they cannot be impacted by other tasks on the queue
44 cargo test test_ops_timing_sensitive -- --ignored --test-threads=1
45
46 # Parallel Tests
47 cargo test test_parallel -- --ignored --nocapture --test-threads=1
48
49 # Device-changed Tests
50 sh run_device_tests.sh
51
52 # Manual Tests
53 # cargo test test_switch_output_device -- --ignored --nocapture
54 # cargo test test_device_collection_change -- --ignored --nocapture
55 # cargo test test_stream_tester -- --ignored --nocapture