added option to add test suites not in a file
This commit is contained in:
parent
5007770e88
commit
bfa12db1db
4 changed files with 16 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
pkgs: files: let
|
||||
pkgs: suite: let
|
||||
test = import ./test.nix;
|
||||
res = builtins.listToAttrs (map test files);
|
||||
res = builtins.listToAttrs (map test suite);
|
||||
resFile = builtins.toFile "results" (builtins.toJSON res);
|
||||
filters = import ./filters.nix;
|
||||
getNix = "import ${./eval.nix} ${resFile}";
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
path: let
|
||||
it = import ./it.nix;
|
||||
describe = import ./describe.nix;
|
||||
suite = import path;
|
||||
suite = if builtins.typeOf path == "path" then import path
|
||||
else path;
|
||||
name = if builtins.typeOf path == "path" then builtins.baseNameOf path
|
||||
else "anonymous";
|
||||
in
|
||||
builtins.trace ("tix: " + builtins.baseNameOf path)
|
||||
builtins.trace "tix: ${name}"
|
||||
(
|
||||
if !builtins.isFunction suite
|
||||
then throw "A test suite should be in the form { it }: [ <tests> ]."
|
||||
else {
|
||||
name = toString path;
|
||||
inherit name;
|
||||
value = builtins.listToAttrs (suite {inherit it describe;});
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue