This crate is aimed toward Rustacean who wish to have a bin folder where they can easily organize all their unit tests to clean their src folder. VSCode extension included! Visit Wiki for more informations.
More features details in wiki.
bash
cargo add tests_bin
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
ext install nas.rust-tests-bin
```rust use testsbin::{ unittests, unittests };
// Will link a module to tests/unit/global_tests.rs
with a module named global_test_rs
.
unit_tests!("globaltests.rs");
// Will link a module to tests/unit/add.rs
with a module named pub_fn_add_usize
.
pub fn add(left: usize, right: usize) -> usize { left + right } ```
Without item : unit__tests!("relative_path.rs" {, "module name"});
With an item : #[unit_tests("relative_path.rs" {, "module name"})] item
The element in {}
are optional. The extension .rs
is required.