Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/.direnv
/mutants.out
/mutants.out.old
/result
/result-*
/target
36 changes: 35 additions & 1 deletion nix/checks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@
}
);

mkMutants =
suffix: features:
toolchains.nightly.mkCargoDerivation (
commonArgs
// {
cargoArtifacts = cargoArtifactsDev;
CARGO_PROFILE = "dev";
pnameSuffix = "-mutants${suffix}";
nativeBuildInputs = [
pkgs.cargo-mutants
pkgs.cargo-nextest
];
buildPhaseCargoCommand = ''
cargo mutants --in-place --test-tool nextest --no-default-features --features ${features}
'';
installPhase = "mkdir -p $out";
}
);

testChecks = pkgs.lib.concatMapAttrs (
tcName: craneLib:
pkgs.lib.mapAttrs' (
Expand Down Expand Up @@ -71,6 +90,9 @@
}
);

mutants-unit = mkMutants "-unit" "unit-tests";
mutants-prop = mkMutants "-prop" "prop-tests";

clippy = toolchains.nightly.cargoClippy (
checkArgs
// {
Expand Down Expand Up @@ -143,7 +165,19 @@
};
nightly = pkgs.symlinkJoin {
name = "nightly-checks-${rev}";
paths = builtins.attrValues checks;
paths = builtins.attrValues (
removeAttrs checks [
"mutants-unit"
"mutants-prop"
]
);
};
mutants = pkgs.symlinkJoin {
name = "mutants-checks";
paths = [
checks.mutants-unit
checks.mutants-prop
];
};
};
};
Expand Down
Loading