How to run only the doctests?


I'm wondering if there's a way to run the doctests (or even a specific one, ideally) without compiling and running all the other tests. I tried cargo test --doc but it seems that it's not supported for dynamic libraries:

❯ cargo test --doc
warning: doc tests are not supported for crate type(s) `dylib` in package `dispatcher`

"cargo test --doc" seems to work if you also build your crate as an rlib:

crate-type = ["dylib", "rlib"]
1 Like

Yep that was it. thank you!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.