我正在研究一个跨越多个板条箱的项目.顶级包(app)需要另外两个包(库)作为依赖.在顶级包中运行货物测试构建依赖关系并运行顶级包的测试,但它不会对其他两个包执行测试.有没有办法
谢谢!
您可以传递-p参数以使Cargo运行依赖项的测试.因此,如果您的包被称为sublib,您可以使用以下命令运行其测试:
cargo test -p sublib
从货物测试 – 帮助:
-p SPEC, –package SPEC Package to run tests for
If the –package argument is given, then SPEC is a package id
specification which indicates which package should be tested. If it is
not given, then the current package is tested. For more information on
SPEC and its format, see thecargo help pkgid
command.