Enable testing during nix builds

This commit is contained in:
Bryan Bennett 2024-01-11 08:31:52 -05:00
parent 04337c8c5f
commit 6e28820659
No known key found for this signature in database
GPG key ID: EE149E4215408DE9
2 changed files with 13 additions and 2 deletions

View file

@ -1,6 +1,9 @@
{ buildDunePackage { alcotest
, bisect_ppx
, buildDunePackage
, core , core
, core_unix , core_unix
, coreutils
, findlib , findlib
, lib , lib
, nix-filter , nix-filter
@ -19,21 +22,29 @@ buildDunePackage {
include = [ include = [
"bin" "bin"
"lib" "lib"
"tests"
./dune-project ./dune-project
./flake.nix ./flake.nix
./default.nix ./default.nix
./flake.lock ./flake.lock
./flake_env.opam ./flake_env.opam
./direnvrc ./direnvrc
./LICENSE
]; ];
}; };
duneVersion = "3"; duneVersion = "3";
doCheck = true;
postPatch = '' postPatch = ''
substituteInPlace direnvrc --replace "@flake_env@" "$out/bin/flake_env" substituteInPlace direnvrc --replace "@flake_env@" "$out/bin/flake_env"
substituteInPlace tests/spit*.sh --replace "/usr/bin/env" "${coreutils}/bin/env"
''; '';
postInstall = '' postInstall = ''
install -m400 -D direnvrc $out/share/flake_env/direnvrc install -m400 -D direnvrc $out/share/flake_env/direnvrc
''; '';
checkInputs = [
alcotest
bisect_ppx
];
nativeBuildInputs = [ nativeBuildInputs = [
reason reason
]; ];

View file

@ -1,2 +1,2 @@
#!/usr/bin/env sh #!/usr/bin/env bash
echo "1.1.1"; echo "1.1.1";