crane/lib/cargoTest.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
457 B
Nix
Raw Permalink Normal View History

{ mkCargoDerivation
}:
{ cargoArtifacts
, cargoExtraArgs ? "--locked"
, 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}";
})