snippetbashTip
cargo test — Execute the unit and integration tests of a Rust package. More information: <https://doc.rust-lang.o
Viewed 0 times
theunitcommandintegrationandexecuteclicargo test
Problem
How to use the
cargo test command: Execute the unit and integration tests of a Rust package. More information: <https://doc.rust-lang.org/cargo/commands/cargo-test.html>.Solution
cargo test — Execute the unit and integration tests of a Rust package. More information: <https://doc.rust-lang.org/cargo/commands/cargo-test.html>.Only run tests containing a specific string in their names:
cargo {{[t|test]}} {{test_name}}Set the number of simultaneous running test cases:
cargo {{[t|test]}} -- --test-threads {{count}}Test artifacts in release mode, with optimizations:
cargo {{[t|test]}} {{[-r|--release]}}Test all packages in the workspace:
cargo {{[t|test]}} --workspaceRun tests for a specific package:
cargo {{[t|test]}} {{[-p|--package]}} {{package}}Run tests without hiding output from test executions:
cargo {{[t|test]}} -- --nocaptureCode Snippets
Only run tests containing a specific string in their names
cargo {{[t|test]}} {{test_name}}Set the number of simultaneous running test cases
cargo {{[t|test]}} -- --test-threads {{count}}Test artifacts in release mode, with optimizations
cargo {{[t|test]}} {{[-r|--release]}}Test all packages in the workspace
cargo {{[t|test]}} --workspaceRun tests for a specific package
cargo {{[t|test]}} {{[-p|--package]}} {{package}}Context
tldr-pages: common/cargo test
Revisions (0)
No revisions yet.