mirror of
https://github.com/foo-dogsquared/nix-module-wrapper-manager-fds.git
synced 2025-01-30 22:57:58 +00:00
wrapper-manager-fds/tests: update test structure for configs
This commit is contained in:
parent
b667a335de
commit
19a035da58
@ -45,6 +45,7 @@
|
||||
system:
|
||||
let
|
||||
pkgs = import sources.nixos-unstable { inherit system; };
|
||||
inherit (pkgs) lib;
|
||||
tests = import ./tests { inherit pkgs; };
|
||||
docs = import ./docs { inherit pkgs; };
|
||||
in
|
||||
@ -60,7 +61,9 @@
|
||||
website = docs.website;
|
||||
};
|
||||
|
||||
checks.wrapperManagerLibrarySetPkg = tests.libTestPkg;
|
||||
checks =
|
||||
{ inherit (tests) lib; }
|
||||
// lib.mapAttrs' (n: v: lib.nameValuePair "config-test-${n}" v) tests.configs;
|
||||
}
|
||||
));
|
||||
}
|
||||
|
@ -7,11 +7,14 @@ in
|
||||
|
||||
let
|
||||
wmLib = (import ../../. { }).lib;
|
||||
build = modules: wmLib.build { inherit pkgs modules; };
|
||||
build = args: wmLib.build (args // { inherit pkgs; });
|
||||
in
|
||||
{
|
||||
fastfetch = build [ ./wrapper-fastfetch.nix ];
|
||||
neofetch = build [ ./wrapper-neofetch.nix ];
|
||||
single-basepackage = build [ ./single-basepackage.nix ];
|
||||
neofetch-with-additional-files = build [ ./neofetch-with-additional-files.nix ];
|
||||
fastfetch = build { modules = [ ./wrapper-fastfetch.nix ]; };
|
||||
neofetch = build {
|
||||
modules = [ ./wrapper-neofetch.nix ];
|
||||
specialArgs.yourMomName = "Yor mom";
|
||||
};
|
||||
single-basepackage = build { modules = [ ./single-basepackage.nix ]; };
|
||||
neofetch-with-additional-files = build { modules = [ ./neofetch-with-additional-files.nix ]; };
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
WHAT
|
||||
'';
|
||||
|
||||
build.extraPassthru.tests = {
|
||||
build.extraPassthru.wrapperManagerTests = {
|
||||
actuallyBuilt =
|
||||
let
|
||||
wrapper = config.build.toplevel;
|
||||
|
@ -13,7 +13,7 @@
|
||||
xdg.desktopEntry.enable = true;
|
||||
};
|
||||
|
||||
build.extraPassthru.tests = {
|
||||
build.extraPassthru.wrapperManagerTests = {
|
||||
singleBasePackage =
|
||||
let
|
||||
wrapper = config.build.toplevel;
|
||||
|
@ -23,7 +23,7 @@
|
||||
hello
|
||||
]);
|
||||
|
||||
build.extraPassthru.tests = {
|
||||
build.extraPassthru.wrapperManagerTests = {
|
||||
actuallyBuilt =
|
||||
let
|
||||
wrapper = config.build.toplevel;
|
||||
|
@ -20,7 +20,7 @@
|
||||
];
|
||||
};
|
||||
|
||||
build.extraPassthru.tests = {
|
||||
build.extraPassthru.wrapperManagerTests = {
|
||||
actuallyBuilt =
|
||||
let
|
||||
wrapper = config.build.toplevel;
|
||||
|
@ -6,14 +6,20 @@ in
|
||||
}:
|
||||
|
||||
let
|
||||
lib = import ./lib { inherit pkgs; };
|
||||
wrapperManagerLibTests = import ./lib { inherit pkgs; };
|
||||
inherit (pkgs) lib;
|
||||
in
|
||||
{
|
||||
inherit lib;
|
||||
libTestPkg =
|
||||
configs = let
|
||||
configs' = import ./configs { inherit pkgs; };
|
||||
updateTestName = configName: package: lib.mapAttrs' (n: v: lib.nameValuePair "${configName}-${n}" v) package.wrapperManagerTests;
|
||||
in
|
||||
lib.concatMapAttrs updateTestName configs';
|
||||
|
||||
lib =
|
||||
pkgs.runCommand "wrapper-manager-fds-lib-test"
|
||||
{
|
||||
testData = builtins.toJSON lib;
|
||||
testData = builtins.toJSON wrapperManagerLibTests;
|
||||
passAsFile = [ "testData" ];
|
||||
nativeBuildInputs = with pkgs; [
|
||||
yajsv
|
||||
@ -23,5 +29,4 @@ in
|
||||
''
|
||||
yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath"
|
||||
'';
|
||||
configs = import ./configs { inherit pkgs; };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user