mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
flake/checks: test extraFiles are in the build
This commit is contained in:
parent
086873bed9
commit
f11f991e09
2 changed files with 34 additions and 0 deletions
|
@ -27,6 +27,8 @@
|
||||||
|
|
||||||
extend = import ../tests/extend.nix { inherit pkgs makeNixvimWithModule; };
|
extend = import ../tests/extend.nix { inherit pkgs makeNixvimWithModule; };
|
||||||
|
|
||||||
|
extra-files = import ../tests/extra-files.nix { inherit pkgs makeNixvimWithModule; };
|
||||||
|
|
||||||
enable-except-in-tests = import ../tests/enable-except-in-tests.nix {
|
enable-except-in-tests = import ../tests/enable-except-in-tests.nix {
|
||||||
inherit pkgs makeNixvimWithModule;
|
inherit pkgs makeNixvimWithModule;
|
||||||
inherit (self.lib.${system}.check) mkTestDerivationFromNixvimModule;
|
inherit (self.lib.${system}.check) mkTestDerivationFromNixvimModule;
|
||||||
|
|
32
tests/extra-files.nix
Normal file
32
tests/extra-files.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ makeNixvimWithModule, pkgs }:
|
||||||
|
let
|
||||||
|
extraFiles = {
|
||||||
|
"one".text = "one";
|
||||||
|
"two".text = "two";
|
||||||
|
"nested/in/dirs/file.txt".text = "nested";
|
||||||
|
"this/file/test.nix".source = ./extra-files.nix;
|
||||||
|
};
|
||||||
|
build = makeNixvimWithModule {
|
||||||
|
module = {
|
||||||
|
inherit extraFiles;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.runCommand "extra-files-test"
|
||||||
|
{
|
||||||
|
root = build.config.filesPlugin;
|
||||||
|
files = builtins.attrNames extraFiles;
|
||||||
|
}
|
||||||
|
''
|
||||||
|
for file in $files; do
|
||||||
|
path="$root"/"$file"
|
||||||
|
if [[ -f "$path" ]]; then
|
||||||
|
echo "File $path exists"
|
||||||
|
else
|
||||||
|
echo "File $path is missing"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
touch $out
|
||||||
|
''
|
Loading…
Add table
Add a link
Reference in a new issue