You can pass the -p option to force Cargo to run dependency tests.
So, if your box is called sublib , you can run its tests using:
cargo test -p sublib
From cargo test --help :
-p SPEC, --package SPEC Package for running tests for
If the -package argument is given, then SPEC is the package identifier specification that indicates which package should be tested. If this is not specified, then the current package is tested. For more information about SPEC and its format, see the cargo help pkgid .
source share