mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
tests: drop use of mkTestDerivationFromNixvimModule
This commit is contained in:
parent
3d90bc786c
commit
1f56d947af
1 changed files with 20 additions and 16 deletions
|
@ -1,6 +1,5 @@
|
||||||
# Collects the various test modules in tests/test-sources/ and groups them into a number of test derivations
|
# Collects the various test modules in tests/test-sources/ and groups them into a number of test derivations
|
||||||
{
|
{
|
||||||
callPackage,
|
|
||||||
callTest,
|
callTest,
|
||||||
helpers,
|
helpers,
|
||||||
lib ? pkgs.lib,
|
lib ? pkgs.lib,
|
||||||
|
@ -11,26 +10,31 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
fetchTests = callTest ./fetch-tests.nix { };
|
fetchTests = callTest ./fetch-tests.nix { };
|
||||||
test-derivation = callPackage ../lib/tests.nix {
|
|
||||||
inherit lib self system;
|
|
||||||
};
|
|
||||||
inherit (test-derivation) mkTestDerivationFromNixvimModule;
|
|
||||||
|
|
||||||
moduleToTest =
|
|
||||||
file: name: module:
|
|
||||||
mkTestDerivationFromNixvimModule {
|
|
||||||
inherit name;
|
|
||||||
module = {
|
|
||||||
_file = file;
|
|
||||||
imports = [ module ];
|
|
||||||
};
|
|
||||||
# Use a single common instance of nixpkgs, with allowUnfree
|
# Use a single common instance of nixpkgs, with allowUnfree
|
||||||
# Having a single shared instance should speed up tests a little
|
# Having a single shared instance should speed up tests a little
|
||||||
pkgs = import self.inputs.nixpkgs {
|
pkgsForTest = import self.inputs.nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
moduleToTest =
|
||||||
|
file: name: module:
|
||||||
|
let
|
||||||
|
configuration = lib.nixvim.modules.evalNixvim {
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
test.name = lib.mkDefault name;
|
||||||
|
_module.args.pkgs = lib.mkForce pkgsForTest;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_file = file;
|
||||||
|
imports = lib.toList module;
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
configuration.config.build.test;
|
||||||
|
|
||||||
# List of files containing configurations
|
# List of files containing configurations
|
||||||
testFiles = fetchTests ./test-sources;
|
testFiles = fetchTests ./test-sources;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue