tests: drop use of mkTestDerivationFromNixvimModule

This commit is contained in:
Matt Sturgeon 2025-03-24 22:48:48 +00:00
parent 3d90bc786c
commit 1f56d947af
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -1,6 +1,5 @@
# Collects the various test modules in tests/test-sources/ and groups them into a number of test derivations
{
callPackage,
callTest,
helpers,
lib ? pkgs.lib,
@ -11,26 +10,31 @@
}:
let
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
# Having a single shared instance should speed up tests a little
pkgs = import self.inputs.nixpkgs {
pkgsForTest = import self.inputs.nixpkgs {
inherit system;
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
testFiles = fetchTests ./test-sources;