1 Execute all unit and integration tests and build examples of a local package
3 Usage: cargo[EXE] test [OPTIONS] [TESTNAME] [-- [ARGS]...]
6 [TESTNAME] If specified, only run tests containing this string in their names
7 [ARGS]... Arguments for the test binary
10 --doc Test only this library's documentation
11 --no-run Compile, but don't run tests
12 --no-fail-fast Run all tests regardless of failure
13 --ignore-rust-version Ignore `rust-version` specification in packages
14 --future-incompat-report Outputs a future incompatibility report at the end of the build
15 --message-format <FMT> Error format
16 -q, --quiet Display one character per test instead of one line
17 -v, --verbose... Use verbose output (-vv very verbose/build.rs output)
18 --color <WHEN> Coloring: auto, always, never
19 --config <KEY=VALUE> Override a configuration value
20 -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
25 -p, --package [<SPEC>] Package to run tests for
26 --workspace Test all packages in the workspace
27 --exclude <SPEC> Exclude packages from the test
28 --all Alias for --workspace (deprecated)
31 --lib Test only this package's library unit tests
32 --bins Test all binaries
33 --bin [<NAME>] Test only the specified binary
34 --examples Test all examples
35 --example [<NAME>] Test only the specified example
36 --tests Test all test targets
37 --test [<NAME>] Test only the specified test target
38 --benches Test all bench targets
39 --bench [<NAME>] Test only the specified bench target
40 --all-targets Test all targets (does not include doctests)
43 -F, --features <FEATURES> Space or comma separated list of features to activate
44 --all-features Activate all available features
45 --no-default-features Do not activate the `default` feature
48 -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs.
49 -r, --release Build artifacts in release mode, with optimizations
50 --profile <PROFILE-NAME> Build artifacts with the specified profile
51 --target [<TRIPLE>] Build for the target triple
52 --target-dir <DIRECTORY> Directory for all generated artifacts
53 --unit-graph Output build graph in JSON (unstable)
54 --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json
57 --manifest-path <PATH> Path to Cargo.toml
58 --frozen Require Cargo.lock and cache are up to date
59 --locked Require Cargo.lock is up to date
60 --offline Run without accessing the network
62 Run `cargo help test` for more detailed information.
63 Run `cargo test -- --help` for test binary options.