nix-community.nixvim/tests/checks.nix
traxys f5f33b5390
tests: Allow to skip running neovim (#260)
Some plugins don't really play nicely with being launched in a headless
sandboxed environment. This adds the pseudo option 'tests.dontRun' to
avoid running those tests
2023-03-16 09:13:43 +01:00

25 lines
607 B
Nix

{
makeNixvim,
pkgs,
} @ args: let
tests = import ./plugins {inherit (pkgs) lib;};
check = import ../lib/check.nix args;
checkConfig = check.checkNvim;
in
# We attempt to build & execute all configurations
builtins.mapAttrs (
name: config: let
testAttributes =
if builtins.hasAttr "tests" config
then config.tests
else {
dontRun = false;
};
nvim = makeNixvim (pkgs.lib.attrsets.filterAttrs (n: _: n != "tests") config);
in
checkConfig {
inherit name nvim;
inherit (testAttributes) dontRun;
}
)
tests