April 2026
Intermediate
631 pages
16h 20m
English
In this section, we’ll go over some configuration options while executing tests, such as the following:
Viewing only library test reportsThe first thing to note is that, if your package has multiple binary crates and a single library crate, the cargo test will generate separate reports for each of the binary crate and the library crate. To view only the test reports for the test in the library, we’ll provide the additional flag of --lib to cargo test, as follows:
C:\> cargo test --lib
This approach can be helpful when working on larger projects with many binary crates.
Generating test outputThe test functions, when passed, do not generate any output from the test functions they are testing. For instance, ...
Read now
Unlock full access