summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorThomas Mühlbacher <tmuehlbacher@posteo.net>2024-05-28 19:04:47 +0200
committerThomas Mühlbacher <tmuehlbacher@posteo.net>2024-05-28 19:32:53 +0200
commitb362f12add2b7307cf404ead3b0c4fc75b43422e (patch)
tree9fe8c7b9b6f2ad4eac5e0255950ccab60348f5fe /flake.nix
parent422ae1f1a70c5c97bd26756d0f61ad011ccea87f (diff)
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.
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix18
1 files changed, 18 insertions, 0 deletions
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