tracing-test
tracing-test copied to clipboard
`logs_contain` incompatible with test_case crate
We are using the test case crate to define inputs for our tests. The traced_test macro injects the logs_contain function in the subfunctions which test_case generates, which means the function does not exist at the test definition.
#[test_case(1)]
#[test_case(2)]
#[tracing_test::traced_test]
fn its_a_test(input: u32) {
tracing::info!("{input}");
}
Possibly related: https://github.com/dbrgn/tracing-test/pull/26
Would the suggested change in #26 work for you?
I don't think these changes build anymore:
error[E0433]: failed to resolve: could not find `dispatch` in `tracing
`
--> src/main.rs:10:5
|
10 | #[tracing_test::traced_test(target="shorter_name")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| could not find `dispatch` in `tracing`
| help: a struct with a similar name exists: `Dispatch`
|