You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main readme recommends adding loom as a dev-dependency. Then it goes on to mention having loom tests as integration tests:
For example, if the library includes a test file: tests/loom_my_struct.rs ...
This does not work. Because when building integration tests the main library is not built in #[cfg(test)] mode but rather in the same way cargo build builds it. So the dev-dependencies are not available. As such, the crate can't use loom::thread::spawn etc internally.
Would you recommend only doing loom tests in unit tests? This is what I have seen some of the libraries using loom doing. Or having loom as a normal, but optional, dependency under [dependencies]? Then anyone can activate them when they use the crate. May be good or bad. The bad part is that the crate exposes features normal users are not meant to use. The good part is If the crate itself implements synchronization primitives, then users of that crate can activate the loom feature if they want to loom test their stuff depending on the synchronization primitives in this library.
The text was updated successfully, but these errors were encountered:
The main readme recommends adding
loom
as adev-dependency
. Then it goes on to mention havingloom
tests as integration tests:This does not work. Because when building integration tests the main library is not built in
#[cfg(test)]
mode but rather in the same waycargo build
builds it. So thedev-dependencies
are not available. As such, the crate can't useloom::thread::spawn
etc internally.Would you recommend only doing
loom
tests in unit tests? This is what I have seen some of the libraries using loom doing. Or havingloom
as a normal, but optional, dependency under[dependencies]
? Then anyone can activate them when they use the crate. May be good or bad. The bad part is that the crate exposes features normal users are not meant to use. The good part is If the crate itself implements synchronization primitives, then users of that crate can activate theloom
feature if they want to loom test their stuff depending on the synchronization primitives in this library.The text was updated successfully, but these errors were encountered: