diff --git a/subprojects/wrapper-manager-fds/tests/default.nix b/subprojects/wrapper-manager-fds/tests/default.nix index 539c82d7..bea84791 100644 --- a/subprojects/wrapper-manager-fds/tests/default.nix +++ b/subprojects/wrapper-manager-fds/tests/default.nix @@ -1,9 +1,19 @@ -{ branch ? "nixos-stable" }: - let sources = import ../npins; - pkgs = import sources.${branch} { }; +in +{ pkgs ? import sources.nixos-unstable { } }: + +let + lib = import ./lib { inherit pkgs; }; in { - lib = import ./lib { inherit pkgs; }; + inherit lib; + libTestPkg = + pkgs.runCommand "wrapper-manager-fds-lib-test" { + testData = builtins.toJSON lib; + passAsFile = [ "testData" ]; + nativeBuildInputs = with pkgs; [ yajsv jq ]; + } '' + yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath" + ''; } diff --git a/subprojects/wrapper-manager-fds/tests/lib/tests.schema.json b/subprojects/wrapper-manager-fds/tests/lib/tests.schema.json new file mode 100644 index 00000000..d1e97e1b --- /dev/null +++ b/subprojects/wrapper-manager-fds/tests/lib/tests.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "wrapper-manager-fds Nix test object", + "type": "object", + "patternProperties": { + "^\\w+$": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 0, + "maxItems": 0 + }, + "required": true + } +} diff --git a/subprojects/wrapper-manager-fds/tests/lib/utils.nix b/subprojects/wrapper-manager-fds/tests/lib/utils.nix index 8f784940..76d7f97b 100644 --- a/subprojects/wrapper-manager-fds/tests/lib/utils.nix +++ b/subprojects/wrapper-manager-fds/tests/lib/utils.nix @@ -3,22 +3,22 @@ lib.runTests { testsUtilsGetBin = { expr = self.utils.getBin [ - ../modules + ../../lib ../../modules ]; expected = [ - (lib.getBin ../modules) + (lib.getBin ../../lib) (lib.getBin ../../modules) ]; }; testsUtilsGetLibexec = { expr = self.utils.getLibexec [ - ../modules + ../../lib ../../modules ]; expected = [ - "${../modules}/libexec" + "${../../lib}/libexec" "${../../modules}/libexec" ]; };