Merge pull request 'nix-unit; update' (#540) from DavHau-jsonschema into main
This commit is contained in:
@@ -138,6 +138,15 @@ rec {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# parse list of unspecified
|
||||||
|
else if
|
||||||
|
(option.type.name == "listOf")
|
||||||
|
&& (option.type.functor.wrapped.name == "unspecified")
|
||||||
|
# return jsonschema property definition for list
|
||||||
|
then default // description // {
|
||||||
|
type = "array";
|
||||||
|
}
|
||||||
|
|
||||||
# parse attrsOf submodule
|
# parse attrsOf submodule
|
||||||
else if option.type.name == "attrsOf" && option.type.nestedTypes.elemType.name == "submodule"
|
else if option.type.name == "attrsOf" && option.type.nestedTypes.elemType.name == "submodule"
|
||||||
# return jsonschema property definition for attrsOf submodule
|
# return jsonschema property definition for attrsOf submodule
|
||||||
|
|||||||
@@ -115,6 +115,18 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
testListOfUnspacified =
|
||||||
|
let
|
||||||
|
default = [ 1 2 3 ];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
expr = slib.parseOption (evalType (lib.types.listOf lib.types.unspecified) default);
|
||||||
|
expected = {
|
||||||
|
type = "array";
|
||||||
|
inherit default description;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
testAttrsOfInt =
|
testAttrsOfInt =
|
||||||
let
|
let
|
||||||
default = { foo = 1; bar = 2; baz = 3; };
|
default = { foo = 1; bar = 2; baz = 3; };
|
||||||
|
|||||||
@@ -1,43 +1,8 @@
|
|||||||
{ stdenv
|
{ callPackage }:
|
||||||
, lib
|
let
|
||||||
, nixVersions
|
nix-unit-src = builtins.fetchGit {
|
||||||
, fetchFromGitHub
|
url = "https://github.com/adisbladis/nix-unit";
|
||||||
, nlohmann_json
|
rev = "7e2ee1c70f930b9b65b9fc33c3f3eca0dfae00d1";
|
||||||
, boost
|
|
||||||
, meson
|
|
||||||
, pkg-config
|
|
||||||
, ninja
|
|
||||||
, cmake
|
|
||||||
, clang-tools
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "nix-unit";
|
|
||||||
version = "0.1";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "adisbladis";
|
|
||||||
repo = "nix-unit";
|
|
||||||
rev = "6389f27c0a13df001d790adfaa08ec4d971ba34a";
|
|
||||||
sha256 = "sha256-bwuiM+2sLrn+vvwW9fv/+s3oh0jN4y6gZV6Lx0pEEmM=";
|
|
||||||
};
|
};
|
||||||
buildInputs = [
|
in
|
||||||
nlohmann_json
|
callPackage nix-unit-src { }
|
||||||
nixVersions.stable
|
|
||||||
boost
|
|
||||||
];
|
|
||||||
nativeBuildInputs = [
|
|
||||||
meson
|
|
||||||
pkg-config
|
|
||||||
ninja
|
|
||||||
# nlohmann_json can be only discovered via cmake files
|
|
||||||
cmake
|
|
||||||
] ++ (lib.optional stdenv.cc.isClang [ clang-tools ]);
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Nix unit test runner";
|
|
||||||
homepage = "https://github.com/adisbladis/nix-unit";
|
|
||||||
license = lib.licenses.gpl3;
|
|
||||||
maintainers = with lib.maintainers; [ adisbladis ];
|
|
||||||
platforms = lib.platforms.unix;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user