tests_bin 1.0.0

Simple solution to organize unit tests. VSCode extension included!
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented3 out of 3 items with examples
  • Size
  • Source code size: 113 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 283.06 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • NickelAngeStudio/tests_bin
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • NickelAngeStudio

ubuntu-latest windows-latest macos-latest ubuntu-performance windows-performance macos-performance

tests_bin

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.

Features

Crate

  • 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.

VSCode Extension

  • Shortcut to create new unit tests file in bin folder.
  • Open your unit tests files directly from your code.
  • Shortcuts to rename and delete unit tests file.
  • Customizable new unit tests file template.
  • Lots of settings to fit your taste.

More features details in wiki.

Installation

cargo add tests_bin

VSCode extension installation

Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.

ext install nas.rust-tests-bin

Usage

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
}

Syntax

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.

License

MIT