traced-test 0.2.0

this crate lets us use #[traced_test] to automatically configure sane default tracing for a rust test
Documentation

traced-test

traced-test is a Rust crate providing a procedural macro to enhance test functions with tracing capabilities. It ensures that test functions are traced and that their events are buffered and flushed appropriately.

Features

  • Automatic Tracing: Automatically sets up tracing for test functions.
  • Error Handling: Ensures proper error handling and flushing of trace logs upon test failures.
  • Simple Integration: Easy to integrate with existing test functions by replacing the #[test] attribute.

Usage

Add Dependency

Add the following to your Cargo.toml:

[dependencies]
traced-test = "0.1"
tracing-setup = "0.1"
tracing = "0.1"
syn = { version = "1.0", features = ["full"] }
quote = "1.0"

Example

Here's an example of how to use traced-test:

use traced_test::traced_test;

#[traced_test]
fn example_test() {
    assert_eq!(1 + 1, 2);
}

License

This project is licensed under the MIT license.