瀏覽代碼

cargo-test: add page (#4268)

Axel Navarro 4 年之前
父節點
當前提交
9931dfbd1e
共有 1 個文件被更改,包括 28 次插入0 次删除
  1. 28 0
      pages/common/cargo-test.md

+ 28 - 0
pages/common/cargo-test.md

@@ -0,0 +1,28 @@
+# cargo-test
+
+> Execute the unit and integration tests of a Rust package.
+> More information: <https://doc.rust-lang.org/cargo/commands/cargo-test.html>.
+
+- Only run tests containing a specific string in their names:
+
+`cargo test {{testname}}`
+
+- Set the number of simultaneous running test cases:
+
+`cargo test -- --test-threads={{count}}`
+
+- Require that `Cargo.lock` is up to date:
+
+`cargo test --locked`
+
+- Test artifacts in release mode, with optimizations:
+
+`cargo test --release`
+
+- Test all packages in the workspace:
+
+`cargo test --workspace`
+
+- Run tests for a package:
+
+`cargo test --package {{package}}`