Skip to content

Commit b03ffcd

Browse files
committed
tests: use callTest pattern
1 parent 2abefa3 commit b03ffcd

File tree

3 files changed

+15
-32
lines changed

3 files changed

+15
-32
lines changed

tests/default.nix

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,19 @@ let
2727
callTests = lib.callPackagesWith autoArgs;
2828
in
2929
{
30-
extra-args-tests = import ./extra-args.nix {
31-
inherit pkgs;
32-
inherit makeNixvimWithModule;
33-
};
34-
extend = import ./extend.nix { inherit pkgs makeNixvimWithModule; };
35-
extra-files = import ./extra-files.nix { inherit pkgs makeNixvimWithModule; };
36-
enable-except-in-tests = import ./enable-except-in-tests.nix {
37-
inherit pkgs makeNixvimWithModule;
38-
inherit (self.lib.${system}.check) mkTestDerivationFromNixvimModule;
39-
};
30+
extra-args-tests = callTest ./extra-args.nix { };
31+
extend = callTest ./extend.nix { };
32+
extra-files = callTest ./extra-files.nix { };
33+
enable-except-in-tests = callTest ./enable-except-in-tests.nix { };
4034
failing-tests = callTest ./failing-tests.nix { };
41-
no-flake = import ./no-flake.nix {
42-
inherit system;
43-
inherit (self.lib.${system}.check) mkTestDerivationFromNvim;
44-
nixvim = "${self}";
45-
};
46-
lib-tests = import ./lib-tests.nix {
47-
inherit pkgs helpers;
48-
inherit (pkgs) lib;
49-
};
50-
maintainers = import ./maintainers.nix { inherit pkgs; };
35+
no-flake = callTest ./no-flake.nix { };
36+
lib-tests = callTest ./lib-tests.nix { };
37+
maintainers = callTest ./maintainers.nix { };
5138
plugins-by-name = callTest ./plugins-by-name.nix { };
5239
generated = callTest ./generated.nix { };
5340
package-options = callTest ./package-options.nix { };
5441
lsp-all-servers = callTest ./lsp-servers.nix { };
5542
}
5643
# Tests generated from ./test-sources
5744
# Grouped as a number of link-farms in the form { test-1, test-2, ... test-N }
58-
// import ./main.nix {
59-
inherit
60-
lib
61-
pkgs
62-
pkgsUnfree
63-
helpers
64-
;
65-
}
45+
// callTests ./main.nix { }

tests/main.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Collects the various test modules in tests/test-sources/ and groups them into a number of test derivations
22
{
3-
lib ? pkgs.lib,
3+
callPackage,
4+
callTest,
45
helpers,
6+
lib ? pkgs.lib,
57
pkgs,
68
pkgsUnfree,
79
}:
810
let
9-
fetchTests = import ./fetch-tests.nix { inherit lib pkgs helpers; };
10-
test-derivation = import ../lib/tests.nix { inherit pkgs lib; };
11+
fetchTests = callTest ./fetch-tests.nix { };
12+
test-derivation = callPackage ../lib/tests.nix { };
1113
inherit (test-derivation) mkTestDerivationFromNixvimModule;
1214

1315
moduleToTest =

tests/no-flake.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2+
nixvim ? "${self}",
3+
self ? throw "either supply `self` or `nixvim`",
24
system,
3-
nixvim,
45
mkTestDerivationFromNvim,
56
}:
67
let

0 commit comments

Comments
 (0)