Matthew Maurer | bd39854 | 2019-09-05 16:25:08 -0700 | [diff] [blame] | 1 | '\" t |
| 2 | .\" Title: cargo-test |
| 3 | .\" Author: [see the "AUTHOR(S)" section] |
| 4 | .\" Generator: Asciidoctor 1.5.8 |
| 5 | .\" Date: 2019-05-08 |
| 6 | .\" Manual: \ \& |
| 7 | .\" Source: \ \& |
| 8 | .\" Language: English |
| 9 | .\" |
| 10 | .TH "CARGO\-TEST" "1" "2019-05-08" "\ \&" "\ \&" |
| 11 | .ie \n(.g .ds Aq \(aq |
| 12 | .el .ds Aq ' |
| 13 | .ss \n[.ss] 0 |
| 14 | .nh |
| 15 | .ad l |
| 16 | .de URL |
| 17 | \fI\\$2\fP <\\$1>\\$3 |
| 18 | .. |
| 19 | .als MTO URL |
| 20 | .if \n[.g] \{\ |
| 21 | . mso www.tmac |
| 22 | . am URL |
| 23 | . ad l |
| 24 | . . |
| 25 | . am MTO |
| 26 | . ad l |
| 27 | . . |
| 28 | . LINKSTYLE blue R < > |
| 29 | .\} |
| 30 | .SH "NAME" |
| 31 | cargo\-test \- Execute unit and integration tests of a package |
| 32 | .SH "SYNOPSIS" |
| 33 | .sp |
| 34 | \fBcargo test [\fIOPTIONS\fP] [TESTNAME] [\-\- \fITEST\-OPTIONS\fP]\fP |
| 35 | .SH "DESCRIPTION" |
| 36 | .sp |
| 37 | Compile and execute unit and integration tests. |
| 38 | .sp |
| 39 | The test filtering argument \fBTESTNAME\fP and all the arguments following the two |
| 40 | dashes (\fB\-\-\fP) are passed to the test binaries and thus to \fIlibtest\fP (rustc\(cqs |
| 41 | built in unit\-test and micro\-benchmarking framework). If you\(cqre passing |
| 42 | arguments to both Cargo and the binary, the ones after \fB\-\-\fP go to the binary, |
| 43 | the ones before go to Cargo. For details about libtest\(cqs arguments see the |
| 44 | output of \fBcargo test \(em \-\-help\fP. As an example, this will run all tests with |
| 45 | \fBfoo\fP in their name on 3 threads in parallel: |
| 46 | .sp |
| 47 | .if n .RS 4 |
| 48 | .nf |
| 49 | cargo test foo \-\- \-\-test\-threads 3 |
| 50 | .fi |
| 51 | .if n .RE |
| 52 | .sp |
| 53 | Tests are built with the \fB\-\-test\fP option to \fBrustc\fP which creates an |
| 54 | executable with a \fBmain\fP function that automatically runs all functions |
| 55 | annotated with the \fB#[test]\fP attribute in multiple threads. \fB#[bench]\fP |
| 56 | annotated functions will also be run with one iteration to verify that they |
| 57 | are functional. |
| 58 | .sp |
| 59 | The libtest harness may be disabled by setting \fBharness = false\fP in the target |
| 60 | manifest settings, in which case your code will need to provide its own \fBmain\fP |
| 61 | function to handle running tests. |
| 62 | .sp |
| 63 | Documentation tests are also run by default, which is handled by \fBrustdoc\fP. It |
| 64 | extracts code samples from documentation comments and executes them. See the |
| 65 | .URL "https://doc.rust\-lang.org/rustdoc/" "rustdoc book" " " |
| 66 | for more information on |
| 67 | writing doc tests. |
| 68 | .SH "OPTIONS" |
| 69 | .SS "Test Options" |
| 70 | .sp |
| 71 | \fB\-\-no\-run\fP |
| 72 | .RS 4 |
| 73 | Compile, but don\(cqt run tests. |
| 74 | .RE |
| 75 | .sp |
| 76 | \fB\-\-no\-fail\-fast\fP |
| 77 | .RS 4 |
| 78 | Run all tests regardless of failure. Without this flag, Cargo will exit |
| 79 | after the first executable fails. The Rust test harness will run all |
| 80 | tests within the executable to completion, this flag only applies to |
| 81 | the executable as a whole. |
| 82 | .RE |
| 83 | .SS "Package Selection" |
| 84 | .sp |
| 85 | By default, when no package selection options are given, the packages selected |
| 86 | depend on the current working directory. In the root of a virtual workspace, |
| 87 | all workspace members are selected (\fB\-\-all\fP is implied). Otherwise, only the |
| 88 | package in the current directory will be selected. The default packages may be |
| 89 | overridden with the \fBworkspace.default\-members\fP key in the root \fBCargo.toml\fP |
| 90 | manifest. |
| 91 | .sp |
| 92 | \fB\-p\fP \fISPEC\fP..., \fB\-\-package\fP \fISPEC\fP... |
| 93 | .RS 4 |
| 94 | Test only the specified packages. See \fBcargo\-pkgid\fP(1) for the |
| 95 | SPEC format. This flag may be specified multiple times. |
| 96 | .RE |
| 97 | .sp |
| 98 | \fB\-\-all\fP |
| 99 | .RS 4 |
| 100 | Test all members in the workspace. |
| 101 | .RE |
| 102 | .sp |
| 103 | \fB\-\-exclude\fP \fISPEC\fP... |
| 104 | .RS 4 |
| 105 | Exclude the specified packages. Must be used in conjunction with the |
| 106 | \fB\-\-all\fP flag. This flag may be specified multiple times. |
| 107 | .RE |
| 108 | .SS "Target Selection" |
| 109 | .sp |
| 110 | When no target selection options are given, \fBcargo test\fP will build the |
| 111 | following targets of the selected packages: |
| 112 | .sp |
| 113 | .RS 4 |
| 114 | .ie n \{\ |
| 115 | \h'-04'\(bu\h'+03'\c |
| 116 | .\} |
| 117 | .el \{\ |
| 118 | . sp -1 |
| 119 | . IP \(bu 2.3 |
| 120 | .\} |
| 121 | lib — used to link with binaries, examples, integration tests, and doc tests |
| 122 | .RE |
| 123 | .sp |
| 124 | .RS 4 |
| 125 | .ie n \{\ |
| 126 | \h'-04'\(bu\h'+03'\c |
| 127 | .\} |
| 128 | .el \{\ |
| 129 | . sp -1 |
| 130 | . IP \(bu 2.3 |
| 131 | .\} |
| 132 | bins (only if integration tests are built and required features are |
| 133 | available) |
| 134 | .RE |
| 135 | .sp |
| 136 | .RS 4 |
| 137 | .ie n \{\ |
| 138 | \h'-04'\(bu\h'+03'\c |
| 139 | .\} |
| 140 | .el \{\ |
| 141 | . sp -1 |
| 142 | . IP \(bu 2.3 |
| 143 | .\} |
| 144 | examples — to ensure they compile |
| 145 | .RE |
| 146 | .sp |
| 147 | .RS 4 |
| 148 | .ie n \{\ |
| 149 | \h'-04'\(bu\h'+03'\c |
| 150 | .\} |
| 151 | .el \{\ |
| 152 | . sp -1 |
| 153 | . IP \(bu 2.3 |
| 154 | .\} |
| 155 | lib as a unit test |
| 156 | .RE |
| 157 | .sp |
| 158 | .RS 4 |
| 159 | .ie n \{\ |
| 160 | \h'-04'\(bu\h'+03'\c |
| 161 | .\} |
| 162 | .el \{\ |
| 163 | . sp -1 |
| 164 | . IP \(bu 2.3 |
| 165 | .\} |
| 166 | bins as unit tests |
| 167 | .RE |
| 168 | .sp |
| 169 | .RS 4 |
| 170 | .ie n \{\ |
| 171 | \h'-04'\(bu\h'+03'\c |
| 172 | .\} |
| 173 | .el \{\ |
| 174 | . sp -1 |
| 175 | . IP \(bu 2.3 |
| 176 | .\} |
| 177 | integration tests |
| 178 | .RE |
| 179 | .sp |
| 180 | .RS 4 |
| 181 | .ie n \{\ |
| 182 | \h'-04'\(bu\h'+03'\c |
| 183 | .\} |
| 184 | .el \{\ |
| 185 | . sp -1 |
| 186 | . IP \(bu 2.3 |
| 187 | .\} |
| 188 | doc tests for the lib target |
| 189 | .RE |
| 190 | .sp |
| 191 | The default behavior can be changed by setting the \fBtest\fP flag for the target |
| 192 | in the manifest settings. Setting examples to \fBtest = true\fP will build and run |
| 193 | the example as a test. Setting targets to \fBtest = false\fP will stop them from |
| 194 | being tested by default. Target selection options that take a target by name |
| 195 | ignore the \fBtest\fP flag and will always test the given target. |
| 196 | .sp |
| 197 | Doc tests for libraries may be disabled by setting \fBdoctest = false\fP for the |
| 198 | library in the manifest. |
| 199 | .sp |
| 200 | Passing target selection flags will test only the |
| 201 | specified targets. |
| 202 | .sp |
| 203 | \fB\-\-lib\fP |
| 204 | .RS 4 |
| 205 | Test the package\(cqs library. |
| 206 | .RE |
| 207 | .sp |
| 208 | \fB\-\-bin\fP \fINAME\fP... |
| 209 | .RS 4 |
| 210 | Test the specified binary. This flag may be specified multiple times. |
| 211 | .RE |
| 212 | .sp |
| 213 | \fB\-\-bins\fP |
| 214 | .RS 4 |
| 215 | Test all binary targets. |
| 216 | .RE |
| 217 | .sp |
| 218 | \fB\-\-example\fP \fINAME\fP... |
| 219 | .RS 4 |
| 220 | Test the specified example. This flag may be specified multiple times. |
| 221 | .RE |
| 222 | .sp |
| 223 | \fB\-\-examples\fP |
| 224 | .RS 4 |
| 225 | Test all example targets. |
| 226 | .RE |
| 227 | .sp |
| 228 | \fB\-\-test\fP \fINAME\fP... |
| 229 | .RS 4 |
| 230 | Test the specified integration test. This flag may be specified multiple |
| 231 | times. |
| 232 | .RE |
| 233 | .sp |
| 234 | \fB\-\-tests\fP |
| 235 | .RS 4 |
| 236 | Test all targets in test mode that have the \fBtest = true\fP manifest |
| 237 | flag set. By default this includes the library and binaries built as |
| 238 | unittests, and integration tests. Be aware that this will also build any |
| 239 | required dependencies, so the lib target may be built twice (once as a |
| 240 | unittest, and once as a dependency for binaries, integration tests, etc.). |
| 241 | Targets may be enabled or disabled by setting the \fBtest\fP flag in the |
| 242 | manifest settings for the target. |
| 243 | .RE |
| 244 | .sp |
| 245 | \fB\-\-bench\fP \fINAME\fP... |
| 246 | .RS 4 |
| 247 | Test the specified benchmark. This flag may be specified multiple times. |
| 248 | .RE |
| 249 | .sp |
| 250 | \fB\-\-benches\fP |
| 251 | .RS 4 |
| 252 | Test all targets in benchmark mode that have the \fBbench = true\fP |
| 253 | manifest flag set. By default this includes the library and binaries built |
| 254 | as benchmarks, and bench targets. Be aware that this will also build any |
| 255 | required dependencies, so the lib target may be built twice (once as a |
| 256 | benchmark, and once as a dependency for binaries, benchmarks, etc.). |
| 257 | Targets may be enabled or disabled by setting the \fBbench\fP flag in the |
| 258 | manifest settings for the target. |
| 259 | .RE |
| 260 | .sp |
| 261 | \fB\-\-all\-targets\fP |
| 262 | .RS 4 |
| 263 | Test all targets. This is equivalent to specifying \fB\-\-lib \-\-bins |
| 264 | \-\-tests \-\-benches \-\-examples\fP. |
| 265 | .RE |
| 266 | .sp |
| 267 | \fB\-\-doc\fP |
| 268 | .RS 4 |
| 269 | Test only the library\(cqs documentation. This cannot be mixed with other |
| 270 | target options. |
| 271 | .RE |
| 272 | .SS "Feature Selection" |
| 273 | .sp |
| 274 | When no feature options are given, the \fBdefault\fP feature is activated for |
| 275 | every selected package. |
| 276 | .sp |
| 277 | \fB\-\-features\fP \fIFEATURES\fP |
| 278 | .RS 4 |
| 279 | Space or comma separated list of features to activate. These features only |
| 280 | apply to the current directory\(cqs package. Features of direct dependencies |
| 281 | may be enabled with \fB<dep\-name>/<feature\-name>\fP syntax. |
| 282 | .RE |
| 283 | .sp |
| 284 | \fB\-\-all\-features\fP |
| 285 | .RS 4 |
| 286 | Activate all available features of all selected packages. |
| 287 | .RE |
| 288 | .sp |
| 289 | \fB\-\-no\-default\-features\fP |
| 290 | .RS 4 |
| 291 | Do not activate the \fBdefault\fP feature of the current directory\(cqs |
| 292 | package. |
| 293 | .RE |
| 294 | .SS "Compilation Options" |
| 295 | .sp |
| 296 | \fB\-\-target\fP \fITRIPLE\fP |
| 297 | .RS 4 |
| 298 | Test for the given architecture. The default is the host |
| 299 | architecture. The general format of the triple is |
| 300 | \fB<arch><sub>\-<vendor>\-<sys>\-<abi>\fP. Run \fBrustc \-\-print target\-list\fP for a |
| 301 | list of supported targets. |
| 302 | .sp |
| 303 | This may also be specified with the \fBbuild.target\fP |
| 304 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 305 | .RE |
| 306 | .sp |
| 307 | \fB\-\-release\fP |
| 308 | .RS 4 |
| 309 | Test optimized artifacts with the \fBrelease\fP profile. See the |
| 310 | PROFILES section for details on how this affects profile selection. |
| 311 | .RE |
| 312 | .SS "Output Options" |
| 313 | .sp |
| 314 | \fB\-\-target\-dir\fP \fIDIRECTORY\fP |
| 315 | .RS 4 |
| 316 | Directory for all generated artifacts and intermediate files. May also be |
| 317 | specified with the \fBCARGO_TARGET_DIR\fP environment variable, or the |
| 318 | \fBbuild.target\-dir\fP \c |
| 319 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 320 | Defaults |
| 321 | to \fBtarget\fP in the root of the workspace. |
| 322 | .RE |
| 323 | .SS "Display Options" |
| 324 | .sp |
| 325 | By default the Rust test harness hides output from test execution to keep |
| 326 | results readable. Test output can be recovered (e.g., for debugging) by passing |
| 327 | \fB\-\-nocapture\fP to the test binaries: |
| 328 | .sp |
| 329 | .if n .RS 4 |
| 330 | .nf |
| 331 | cargo test \-\- \-\-nocapture |
| 332 | .fi |
| 333 | .if n .RE |
| 334 | .sp |
| 335 | \fB\-v\fP, \fB\-\-verbose\fP |
| 336 | .RS 4 |
| 337 | Use verbose output. May be specified twice for "very verbose" output which |
| 338 | includes extra output such as dependency warnings and build script output. |
| 339 | May also be specified with the \fBterm.verbose\fP |
| 340 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 341 | .RE |
| 342 | .sp |
| 343 | \fB\-q\fP, \fB\-\-quiet\fP |
| 344 | .RS 4 |
| 345 | No output printed to stdout. |
| 346 | .RE |
| 347 | .sp |
| 348 | \fB\-\-color\fP \fIWHEN\fP |
| 349 | .RS 4 |
| 350 | Control when colored output is used. Valid values: |
| 351 | .sp |
| 352 | .RS 4 |
| 353 | .ie n \{\ |
| 354 | \h'-04'\(bu\h'+03'\c |
| 355 | .\} |
| 356 | .el \{\ |
| 357 | . sp -1 |
| 358 | . IP \(bu 2.3 |
| 359 | .\} |
| 360 | \fBauto\fP (default): Automatically detect if color support is available on the |
| 361 | terminal. |
| 362 | .RE |
| 363 | .sp |
| 364 | .RS 4 |
| 365 | .ie n \{\ |
| 366 | \h'-04'\(bu\h'+03'\c |
| 367 | .\} |
| 368 | .el \{\ |
| 369 | . sp -1 |
| 370 | . IP \(bu 2.3 |
| 371 | .\} |
| 372 | \fBalways\fP: Always display colors. |
| 373 | .RE |
| 374 | .sp |
| 375 | .RS 4 |
| 376 | .ie n \{\ |
| 377 | \h'-04'\(bu\h'+03'\c |
| 378 | .\} |
| 379 | .el \{\ |
| 380 | . sp -1 |
| 381 | . IP \(bu 2.3 |
| 382 | .\} |
| 383 | \fBnever\fP: Never display colors. |
| 384 | .RE |
| 385 | .sp |
| 386 | May also be specified with the \fBterm.color\fP |
| 387 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 388 | .RE |
| 389 | .sp |
| 390 | \fB\-\-message\-format\fP \fIFMT\fP |
| 391 | .RS 4 |
| 392 | The output format for diagnostic messages. Valid values: |
| 393 | .sp |
| 394 | .RS 4 |
| 395 | .ie n \{\ |
| 396 | \h'-04'\(bu\h'+03'\c |
| 397 | .\} |
| 398 | .el \{\ |
| 399 | . sp -1 |
| 400 | . IP \(bu 2.3 |
| 401 | .\} |
| 402 | \fBhuman\fP (default): Display in a human\-readable text format. |
| 403 | .RE |
| 404 | .sp |
| 405 | .RS 4 |
| 406 | .ie n \{\ |
| 407 | \h'-04'\(bu\h'+03'\c |
| 408 | .\} |
| 409 | .el \{\ |
| 410 | . sp -1 |
| 411 | . IP \(bu 2.3 |
| 412 | .\} |
| 413 | \fBjson\fP: Emit JSON messages to stdout. |
| 414 | .RE |
| 415 | .sp |
| 416 | .RS 4 |
| 417 | .ie n \{\ |
| 418 | \h'-04'\(bu\h'+03'\c |
| 419 | .\} |
| 420 | .el \{\ |
| 421 | . sp -1 |
| 422 | . IP \(bu 2.3 |
| 423 | .\} |
| 424 | \fBshort\fP: Emit shorter, human\-readable text messages. |
| 425 | .RE |
| 426 | .RE |
| 427 | .SS "Manifest Options" |
| 428 | .sp |
| 429 | \fB\-\-manifest\-path\fP \fIPATH\fP |
| 430 | .RS 4 |
| 431 | Path to the \fBCargo.toml\fP file. By default, Cargo searches in the current |
| 432 | directory or any parent directory for the \fBCargo.toml\fP file. |
| 433 | .RE |
| 434 | .sp |
| 435 | \fB\-\-frozen\fP, \fB\-\-locked\fP |
| 436 | .RS 4 |
| 437 | Either of these flags requires that the \fBCargo.lock\fP file is |
| 438 | up\-to\-date. If the lock file is missing, or it needs to be updated, Cargo will |
| 439 | exit with an error. The \fB\-\-frozen\fP flag also prevents Cargo from |
| 440 | attempting to access the network to determine if it is out\-of\-date. |
| 441 | .sp |
| 442 | These may be used in environments where you want to assert that the |
| 443 | \fBCargo.lock\fP file is up\-to\-date (such as a CI build) or want to avoid network |
| 444 | access. |
| 445 | .RE |
| 446 | .sp |
| 447 | \fB\-\-offline\fP |
| 448 | .RS 4 |
| 449 | Prevents Cargo from accessing the network for any reason. Without this |
| 450 | flag, Cargo will stop with an error if it needs to access the network and |
| 451 | the network is not available. With this flag, Cargo will attempt to |
| 452 | proceed without the network if possible. |
| 453 | .sp |
| 454 | Beware that this may result in different dependency resolution than online |
| 455 | mode. Cargo will restrict itself to crates that are downloaded locally, even |
| 456 | if there might be a newer version as indicated in the local copy of the index. |
| 457 | See the \fBcargo\-fetch\fP(1) command to download dependencies before going |
| 458 | offline. |
| 459 | .sp |
| 460 | May also be specified with the \fBnet.offline\fP \c |
| 461 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 462 | .RE |
| 463 | .SS "Common Options" |
| 464 | .sp |
| 465 | \fB\-h\fP, \fB\-\-help\fP |
| 466 | .RS 4 |
| 467 | Prints help information. |
| 468 | .RE |
| 469 | .sp |
| 470 | \fB\-Z\fP \fIFLAG\fP... |
| 471 | .RS 4 |
| 472 | Unstable (nightly\-only) flags to Cargo. Run \fBcargo \-Z help\fP for |
| 473 | details. |
| 474 | .RE |
| 475 | .SS "Miscellaneous Options" |
| 476 | .sp |
| 477 | The \fB\-\-jobs\fP argument affects the building of the test executable but does not |
| 478 | affect how many threads are used when running the tests. The Rust test harness |
| 479 | includes an option to control the number of threads used: |
| 480 | .sp |
| 481 | .if n .RS 4 |
| 482 | .nf |
| 483 | cargo test \-j 2 \-\- \-\-test\-threads=2 |
| 484 | .fi |
| 485 | .if n .RE |
| 486 | .sp |
| 487 | \fB\-j\fP \fIN\fP, \fB\-\-jobs\fP \fIN\fP |
| 488 | .RS 4 |
| 489 | Number of parallel jobs to run. May also be specified with the |
| 490 | \fBbuild.jobs\fP \c |
| 491 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 492 | Defaults to |
| 493 | the number of CPUs. |
| 494 | .RE |
| 495 | .SH "PROFILES" |
| 496 | .sp |
| 497 | Profiles may be used to configure compiler options such as optimization levels |
| 498 | and debug settings. See |
| 499 | \c |
| 500 | .URL "https://doc.rust\-lang.org/cargo/reference/manifest.html#the\-profile\-sections" "the reference" |
| 501 | for more details. |
| 502 | .sp |
| 503 | Profile selection depends on the target and crate being built. By default the |
| 504 | \fBdev\fP or \fBtest\fP profiles are used. If the \fB\-\-release\fP flag is given, then the |
| 505 | \fBrelease\fP or \fBbench\fP profiles are used. |
| 506 | .TS |
| 507 | allbox tab(:); |
| 508 | lt lt lt. |
| 509 | T{ |
| 510 | .sp |
| 511 | Target |
| 512 | T}:T{ |
| 513 | .sp |
| 514 | Default Profile |
| 515 | T}:T{ |
| 516 | .sp |
| 517 | \fB\-\-release\fP Profile |
| 518 | T} |
| 519 | T{ |
| 520 | .sp |
| 521 | lib, bin, example |
| 522 | T}:T{ |
| 523 | .sp |
| 524 | \fBdev\fP |
| 525 | T}:T{ |
| 526 | .sp |
| 527 | \fBrelease\fP |
| 528 | T} |
| 529 | T{ |
| 530 | .sp |
| 531 | test, bench, or any target |
| 532 | .br |
| 533 | in "test" or "bench" mode |
| 534 | T}:T{ |
| 535 | .sp |
| 536 | \fBtest\fP |
| 537 | T}:T{ |
| 538 | .sp |
| 539 | \fBbench\fP |
| 540 | T} |
| 541 | .TE |
| 542 | .sp |
| 543 | .sp |
| 544 | Dependencies use the \fBdev\fP/\fBrelease\fP profiles. |
| 545 | .sp |
| 546 | Unit tests are separate executable artifacts which use the \fBtest\fP/\fBbench\fP |
| 547 | profiles. Example targets are built the same as with \fBcargo build\fP (using the |
| 548 | \fBdev\fP/\fBrelease\fP profiles) unless you are building them with the test harness |
| 549 | (by setting \fBtest = true\fP in the manifest or using the \fB\-\-example\fP flag) in |
| 550 | which case they use the \fBtest\fP/\fBbench\fP profiles. Library targets are built |
| 551 | with the \fBdev\fP/\fBrelease\fP profiles when linked to an integration test, binary, |
| 552 | or doctest. |
| 553 | .SH "ENVIRONMENT" |
| 554 | .sp |
| 555 | See \c |
| 556 | .URL "https://doc.rust\-lang.org/cargo/reference/environment\-variables.html" "the reference" " " |
| 557 | for |
| 558 | details on environment variables that Cargo reads. |
| 559 | .SH "EXIT STATUS" |
| 560 | .sp |
| 561 | 0 |
| 562 | .RS 4 |
| 563 | Cargo succeeded. |
| 564 | .RE |
| 565 | .sp |
| 566 | 101 |
| 567 | .RS 4 |
| 568 | Cargo failed to complete. |
| 569 | .RE |
| 570 | .SH "EXAMPLES" |
| 571 | .sp |
| 572 | .RS 4 |
| 573 | .ie n \{\ |
| 574 | \h'-04' 1.\h'+01'\c |
| 575 | .\} |
| 576 | .el \{\ |
| 577 | . sp -1 |
| 578 | . IP " 1." 4.2 |
| 579 | .\} |
| 580 | Execute all the unit and integration tests of the current package: |
| 581 | .sp |
| 582 | .if n .RS 4 |
| 583 | .nf |
| 584 | cargo test |
| 585 | .fi |
| 586 | .if n .RE |
| 587 | .RE |
| 588 | .sp |
| 589 | .RS 4 |
| 590 | .ie n \{\ |
| 591 | \h'-04' 2.\h'+01'\c |
| 592 | .\} |
| 593 | .el \{\ |
| 594 | . sp -1 |
| 595 | . IP " 2." 4.2 |
| 596 | .\} |
| 597 | Run only a specific test within a specific integration test: |
| 598 | .sp |
| 599 | .if n .RS 4 |
| 600 | .nf |
| 601 | cargo test \-\-test int_test_name \-\- modname::test_name |
| 602 | .fi |
| 603 | .if n .RE |
| 604 | .RE |
| 605 | .SH "SEE ALSO" |
| 606 | .sp |
| 607 | \fBcargo\fP(1), \fBcargo\-bench\fP(1) |