build(nix): add cargo test check

this is pretty much a no-op currently, but hopefully we can make some
use of it in the future.
This commit is contained in:
Thomas Mühlbacher 2024-05-28 19:04:47 +02:00
parent 422ae1f1a7
commit b362f12add

View File

@ -139,6 +139,24 @@
}
);
# we have to build our own `craneLib.cargoTest`
checks.cargo-test = craneLib.mkCargoDerivation (
commonArgs
// {
inherit cargoArtifacts;
doCheck = true;
enableParallelChecking = true;
pnameSuffix = "-test";
buildPhaseCargoCommand = "";
checkPhaseCargoCommand = ''
make ''${enableParallelChecking:+-j''${NIX_BUILD_CORES}} $makeFlags libbcachefs.a
cargo test --profile release -- --nocapture
'';
}
);
devShells.default = pkgs.mkShell {
inputsFrom = [
config.packages.default