create nix test infrastructure

This commit is contained in:
atagen 2024-12-03 12:25:08 +11:00
parent 192561577e
commit 0a9e1c089b
3 changed files with 84 additions and 11 deletions

View file

@ -51,10 +51,37 @@
ocaml-lsp
ocamlformat
ocamlformat-rpc-lib
pkgs.just
];
in {
devShells.default = mkShell {
buildInputs = minimal ++ dev;
shellHook = let
justFile = ''
default:
@just --list
@build:
nix build .#debug --offline
@release:
nix build --offline
@test:
printf "\\n\\n\\t************ running nix+dune tests ************\\n\\n\\n"
nix flake check --offline
nix build .#tests --offline
printf "\\n\\n\\t************ running visual test ************\\n\\n\\n"
echo one two three four | CULRS="(255,0,0);(0,0,255);#00FF00" CULR_ORDER="1;0;2" result/bin/culr
'';
in ''
printf '${justFile}' > justfile
'';
};
checks.default = pkgs.callPackage ./nix/test.nix {
culr = self.packages.${system}.tests;
inherit version;
};
packages.default = pkgs.callPackage ./nix/default.nix {
@ -62,7 +89,18 @@
inherit version;
};
defaultPackage = self.packages.${system}.default;
packages.debug = pkgs.callPackage ./nix/default.nix {
debug = true;
ocaml-deps = minimal;
inherit version;
};
packages.tests = pkgs.callPackage ./nix/default.nix {
debug = true;
ocaml-deps = minimal;
doCheck = true;
inherit version;
};
}
)
// {