buildRustPackage: Add cargoTestFlags

This makes it possible to pass flags to `cargo test`, which is needed if
a crate is compiled with custom feature flags.
This commit is contained in:
Max Hausch
2021-03-02 09:45:26 +01:00
parent fa62f37160
commit ebe3ae4d4d
2 changed files with 9 additions and 1 deletions
+7
View File
@@ -193,6 +193,13 @@ rustPlatform.buildRustPackage {
Please note that the code will be compiled twice here: once in `release` mode
for the `buildPhase`, and again in `debug` mode for the `checkPhase`.
Test flags, e.g., `--features xxx/yyy`, can be passed to `cargo test` via the
`cargoTestFlags` attribute.
Another attribute, called `checkFlags`, is used to pass arguments to the test
binary itself, as stated
(here)[https://doc.rust-lang.org/cargo/commands/cargo-test.html].
#### Tests relying on the structure of the `target/` directory
Some tests may rely on the structure of the `target/` directory. Those tests