🎉 Today I'm releasing `cargo-is-tested`, a tool to check that all your items are tested, and your tests are well written.

59 points NothusID

Hi! Today I'm releasing the first version of cargo-is-tested, a tool to mantain certain quality in your tests.

It's very easy to use, (detailed instructions in the documentation, or book) you just install the binary and import is_tested as a dependency. Then mark your functions with #[is_tested("tests/path_to_tests.rs")]

For example:

#! is-tested strict
// Shebang explained in the book

use is_tested::is_tested;

#[is_tested("tests/my_func_testing_path.rs")]
fn my_func() {
    // [...]
}

Now, you run the binary, it will check that all the things you want tested are tested, and those tests have quality-control.

  • Depending on your configuration, you can control how restrictive you want your test to be.
  • Testing is enabled in a file-by-file thesis, you only test the files you choose to test.
  • You can skip specific items with \#\\[is\\_not\\_tested(reason = "...")\\]\\
  • It has fancy errors, explaining exactly what happened.
  • Lints can be activated from the CLI.
  • Understandable documentation.
  • If a lint doesn't exists, the program makes suggestions (did you mean X?)

\[Book\] \[Crates.io\] \[Repository\] \[Docs.rs\]