cargo test
cargo test --lib # only unit tests
cargo test --no-fail-fast # don't stop after first failed test
cargo test -- --show-output # Show captured stdout of successful tests
cargo nextest run
cargo nextest run --lib # only unit tests
cargo nextest run --no-fail-fast # don't stop after first failed testMocks for testing are normally included during testing. Benchmarking doesn't enable the test and therefore the mocks are not available. To enable them, the feature test-utils must be enabled:
cargo bench --features test-utilscargo llvm-cov # text output
cargo llvm-cov --open # HTML output
cargo llvm-cov --lib # only unit tests
cargo llvm-cov nextest # text output
cargo llvm-cov nextest --open # HTML output
cargo llvm-cov nextest --lib # only unit testsGrant temporary access for perf events:
echo '1' | sudo tee /proc/sys/kernel/perf_event_paranoidCompile and start recording:
cargo build --profile profiling # maybe some feature needs to be enabled as well
samply record ./target/profiling/