2023-03-22 07:42:02 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
2024-10-18 09:44:59 +01:00
|
|
|
helpers,
|
|
|
|
lib,
|
2024-12-14 18:54:27 +00:00
|
|
|
linkFarm,
|
2024-10-18 09:44:59 +01:00
|
|
|
self, # The flake instance
|
2024-12-14 22:41:16 +00:00
|
|
|
system ? pkgs.stdenv.hostPlatform.system,
|
2023-03-22 07:42:02 +01:00
|
|
|
}:
|
|
|
|
let
|
2024-10-17 19:59:37 +01:00
|
|
|
autoArgs = pkgs // {
|
|
|
|
inherit
|
|
|
|
helpers
|
|
|
|
self
|
|
|
|
system
|
|
|
|
;
|
2024-12-15 21:13:45 +01:00
|
|
|
nixpkgsLib = lib;
|
2024-12-21 12:58:33 +00:00
|
|
|
lib = lib.extend self.lib.overlay;
|
2024-10-17 19:59:37 +01:00
|
|
|
inherit (self.legacyPackages.${system})
|
|
|
|
makeNixvimWithModule
|
|
|
|
nixvimConfiguration
|
|
|
|
;
|
|
|
|
inherit (self.lib.${system}.check)
|
|
|
|
mkTestDerivationFromNvim
|
|
|
|
mkTestDerivationFromNixvimModule
|
|
|
|
;
|
|
|
|
# Recursive:
|
|
|
|
inherit callTest callTests;
|
|
|
|
};
|
|
|
|
|
|
|
|
callTest = lib.callPackageWith autoArgs;
|
|
|
|
callTests = lib.callPackagesWith autoArgs;
|
2024-12-14 18:54:27 +00:00
|
|
|
selfPackages = self.packages.${system};
|
2025-05-30 17:37:23 +01:00
|
|
|
|
2025-07-01 00:58:48 +01:00
|
|
|
misc = {
|
|
|
|
extra-args-tests = callTest ./extra-args.nix { };
|
|
|
|
extend = callTest ./extend.nix { };
|
|
|
|
extra-files = callTest ./extra-files.nix { };
|
|
|
|
enable-except-in-tests = callTest ./enable-except-in-tests.nix { };
|
|
|
|
failing-tests = callTest ./failing-tests.nix { };
|
|
|
|
no-flake = callTest ./no-flake.nix { };
|
|
|
|
lib-tests = callTest ./lib-tests.nix { };
|
|
|
|
maintainers = callTest ./maintainers.nix { };
|
|
|
|
nixpkgs-module = callTest ./nixpkgs-module.nix { };
|
|
|
|
plugins-by-name = callTest ./plugins-by-name.nix { };
|
|
|
|
generated = callTest ./generated.nix { };
|
|
|
|
lsp-all-servers = callTest ./lsp-servers.nix { };
|
|
|
|
};
|
|
|
|
|
|
|
|
docs = lib.optionalAttrs (selfPackages ? docs) {
|
|
|
|
# Individual tests can be run using: nix build .#docs.user-configs.tests.<test>
|
|
|
|
docs-user-configs = linkFarm "user-configs-tests" selfPackages.docs.user-configs.tests;
|
|
|
|
};
|
|
|
|
|
|
|
|
# These are always built on all systems, even when `allSystems = false`
|
|
|
|
platforms = callTests ./platforms { };
|
|
|
|
|
|
|
|
# Tests generated from ./test-sources
|
2025-07-01 01:19:42 +01:00
|
|
|
# As a list of { name, path } attrs
|
|
|
|
main = (callTests ./main.nix { }).tests;
|
|
|
|
|
|
|
|
# Combined into a single link-farm derivation
|
|
|
|
mainDrv.tests = linkFarm "tests" main;
|
|
|
|
|
2025-07-01 01:51:58 +01:00
|
|
|
# Grouped as a number of link-farms in the form { tests = { group-1, group-2, ... group-N }; }
|
|
|
|
mainGrouped.tests = lib.pipe main [
|
2025-07-01 01:19:42 +01:00
|
|
|
(helpers.groupListBySize 10)
|
|
|
|
(lib.imap1 (
|
|
|
|
i: group: rec {
|
2025-07-01 01:51:58 +01:00
|
|
|
name = "group-${toString i}";
|
2025-07-01 01:19:42 +01:00
|
|
|
value = linkFarm name group;
|
|
|
|
}
|
|
|
|
))
|
|
|
|
builtins.listToAttrs
|
|
|
|
];
|
2024-07-19 20:22:19 +02:00
|
|
|
in
|
2025-07-01 00:58:48 +01:00
|
|
|
{
|
|
|
|
# TODO: consider whether all these tests are needed in the `checks` output
|
2025-07-01 01:19:42 +01:00
|
|
|
flakeCheck = misc // docs // platforms // mainDrv;
|
2025-05-30 17:37:23 +01:00
|
|
|
|
2025-07-01 00:58:48 +01:00
|
|
|
# TODO: consider whether all these tests are needed to be built by buildbot
|
2025-07-01 01:19:42 +01:00
|
|
|
buildbot = lib.optionalAttrs (system == "x86_64-linux") (misc // docs) // platforms // mainGrouped;
|
2025-07-01 00:58:48 +01:00
|
|
|
}
|