1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/cargo-test.md
2023-10-29 09:54:53 +01:00

28 lines
643 B
Markdown

# 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 test {{testname}}`
- Set the number of simultaneous running test cases:
`cargo test -- --test-threads {{count}}`
- Test artifacts in release mode, with optimizations:
`cargo test --release`
- Test all packages in the workspace:
`cargo test --workspace`
- Run tests for a specific package:
`cargo test --package {{package}}`
- Run tests without hiding output from test executions:
`cargo test -- --nocapture`