Skip to content

Commit 1f56d94

Browse files
committed
tests: drop use of mkTestDerivationFromNixvimModule
1 parent 3d90bc7 commit 1f56d94

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

tests/main.nix

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Collects the various test modules in tests/test-sources/ and groups them into a number of test derivations
22
{
3-
callPackage,
43
callTest,
54
helpers,
65
lib ? pkgs.lib,
@@ -11,26 +10,31 @@
1110
}:
1211
let
1312
fetchTests = callTest ./fetch-tests.nix { };
14-
test-derivation = callPackage ../lib/tests.nix {
15-
inherit lib self system;
13+
14+
# Use a single common instance of nixpkgs, with allowUnfree
15+
# Having a single shared instance should speed up tests a little
16+
pkgsForTest = import self.inputs.nixpkgs {
17+
inherit system;
18+
config.allowUnfree = true;
1619
};
17-
inherit (test-derivation) mkTestDerivationFromNixvimModule;
1820

1921
moduleToTest =
2022
file: name: module:
21-
mkTestDerivationFromNixvimModule {
22-
inherit name;
23-
module = {
24-
_file = file;
25-
imports = [ module ];
26-
};
27-
# Use a single common instance of nixpkgs, with allowUnfree
28-
# Having a single shared instance should speed up tests a little
29-
pkgs = import self.inputs.nixpkgs {
30-
inherit system;
31-
config.allowUnfree = true;
23+
let
24+
configuration = lib.nixvim.modules.evalNixvim {
25+
modules = [
26+
{
27+
test.name = lib.mkDefault name;
28+
_module.args.pkgs = lib.mkForce pkgsForTest;
29+
}
30+
{
31+
_file = file;
32+
imports = lib.toList module;
33+
}
34+
];
3235
};
33-
};
36+
in
37+
configuration.config.build.test;
3438

3539
# List of files containing configurations
3640
testFiles = fetchTests ./test-sources;

0 commit comments

Comments
 (0)