From b362f12add2b7307cf404ead3b0c4fc75b43422e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BChlbacher?= Date: Tue, 28 May 2024 19:04:47 +0200 Subject: [PATCH] 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. --- flake.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/flake.nix b/flake.nix index c6f5e6aa..fb1e420d 100644 --- a/flake.nix +++ b/flake.nix @@ -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