Crates.io | tests_bin |
lib.rs | tests_bin |
version | 1.0.0 |
source | src |
created_at | 2023-04-28 18:36:31.00556 |
updated_at | 2023-04-28 18:36:31.00556 |
description | Simple solution to organize unit tests. VSCode extension included! |
homepage | https://github.com/NickelAngeStudio/tests_bin/wiki |
repository | https://github.com/NickelAngeStudio/tests_bin |
max_upload_size | |
id | 851639 |
size | 113,401 |
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.
Organize your unit tests with one relative path.
Automatically create your unit tests module name.
Add attribute macro directly above your item for easier unit tests tracking.
Work with rust-analyzer to run your tests.
Unit tests folder path is customizable.
More features details in wiki.
cargo add tests_bin
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
ext install nas.rust-tests-bin
use tests_bin::{ unit__tests, unit_tests };
// Will link a module to `tests/unit/global_tests.rs` with a module named `global_test_rs`.
unit__tests!("global_tests.rs");
// Will link a module to `tests/unit/add.rs` with a module named `pub_fn_add_usize`.
#[unit_tests("add.rs")]
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.