-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.nix
35 lines (34 loc) · 818 Bytes
/
test.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ lilgit
, rustfmt
, shellcheck
, bashInteractive
, git
, bats
, bats-require
}:
{
upstream = lilgit.unresholved.overrideAttrs (old: {
name = "${old.pname}-tests";
dontInstall = true; # just need the build directory
doCheck = true;
checkInputs = [ rustfmt shellcheck ];
checkPhase = ''
shellcheck lilgit.bash
rustfmt lilgitd.rs --check
'';
doInstallCheck = true;
installCheckInputs = [
bashInteractive
git
bats
# (bats.withLibraries (p: [ bats-require ]))
];
# TODO: see if LILGIT env is moot now that this is its own drv
installCheckPhase = ''
export LILGIT=${lilgit}/bin/lilgit.bash
cat tests/head.bats tests/repo.bash > tests/ephemeral.bats
bats --verbose-run tests/ephemeral.bats
touch $out
'';
});
}