Hi there,
I do have two crates: parent
and child
.
The child crate uses some conditional compilation that should only be compiled while testing the crate.
The child crate is maintained as dev-dependency
to my parent crate. However, when running the tests on the parent crate the child is not compiled with the test
configuration.
I kind of understand why this is the case - as otherwise all unit tests of dependent crates might be run as well while parent is testet, but is there any way to do some conditional compilation checks in the child that are only taken into consideration when compiled/run in test mode ?
The only idea that comes into my mind would be a specific feature flag for child
if used in the dev-dependencies like:
[dev-dependencies]
child = { path = "../child", features = ["test"] }
is there another more built-in way of achieving this ?
Thanks in advance.