Closed bachrc closed 9 months ago
@bachrc it always worked for us. Didn't you miss
[[test]]
name = "example"
harness = false
in your Cargo.toml
?
Yup! I have a simple workspace which contains the integration_tests
member.
This crate has this [[test]] section. So when I launch cargo test -p integration_tests --test example
, it doesn't detect any test in my integration_tests/tests/example.rs
. Unless I annotate with #[tokio::test]
I am sorry for making you lose some time, this was a shitty mistake on my end...
I wrote [[tests]]
in my Cargo.toml file, and not [[test]]
... works way better now. Thank you for your wonderful library, please have a nice day
In the official documentation, the recommended way to add a test is to make a
example.rs
test, and to do amain()
function with eitherfutures
or a#[tokio::main]
to contains theWorld::run
.Though, this method is not detected when doing
cargo test --test example
. Because it only detects methods annotated with#[test]
, examples everywhere in the documentation does not work, unless the method is annotated with#[tokio::test]