Cannot run Mutants on complex build setup #483
-
I'm working with a codebase that has both a binary and a library, the binary is for an embedded device and the library can be run on embedded device and on the host computer. The library itself is unit tested using Is there a way to configure mutants so it will only go after the tests in the library? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If the binary and library are in different packages you should be able to run If they're in the same package then it might be more complicated.
If the binary fails to build on the host and you want it in the same package then perhaps you could use https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-required-features-field so that the binary can be turned on only on places where it will work? |
Beta Was this translation helpful? Give feedback.
If the binary and library are in different packages you should be able to run
cargo mutants -p whateverlib
?If they're in the same package then it might be more complicated.
mutants.out/debug.log
will show what command it's running, I guess something likecargo test --no-run --verbose [email protected]
. Does this fail in your package, on the host?If the binary fails to build on the host and you want it in the same package then perhaps you could use https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-required-features-field so that the binary can be turned on only on places where it will work?