Running tests
This will produce output that looks like:
In the output above:
- Tests are marked or
FAIL
, and the amount of wall-clock time each test takes is listed within square brackets. In the example above,test_list_tests
passed and took 0.603 seconds to execute. -
- an integration test binary built from tests in the
[[test]]
section of (typically tests in thetests
directory.) These tests are shown by nextest in the formatcrate-name::bin-name
.
For more about unit and integration tests, see the documentation for
cargo test
. - an integration test binary built from tests in the
- The part after the test binary is the test name, including the module the test is in. The final part of the test name is highlighted in bold blue text.
cargo nextest run
supports all the options that cargo test
does. For example, to only execute tests for a package called :
For a full list of options accepted by cargo nextest run
, see cargo nextest run --help
.
This is different from cargo test
, where you have to specify a --
, for example: cargo test -- <test-name1> <test-name2>...
.
Displaying live test output
By default, will capture test output and only display it on failure. If you do not want to capture test output:
In this mode, cargo-nextest will run tests serially so that output from different tests isn’t interspersed. This is different from cargo test -- --nocapture
, which will run tests in parallel.