crane/lib/cargoTest.nix

23 lines
449 B
Nix
Raw Normal View History

{ mkCargoDerivation
}:
{ cargoArtifacts
, cargoExtraArgs ? ""
, cargoTestExtraArgs ? ""
, ...
}@origArgs:
let
args = (builtins.removeAttrs origArgs [
"cargoExtraArgs"
"cargoTestExtraArgs"
]);
in
mkCargoDerivation (args // {
inherit cargoArtifacts;
doCheck = args.doCheck or true;
pnameSuffix = "-test";
buildPhaseCargoCommand = "";
checkPhaseCargoCommand = "cargoWithProfile test ${cargoExtraArgs} ${cargoTestExtraArgs}";
})