add describe function
This commit is contained in:
parent
0b7f5ad721
commit
0dd646775e
7 changed files with 80 additions and 37 deletions
8
tix/describe.nix
Normal file
8
tix/describe.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
name:
|
||||
map ({
|
||||
msg,
|
||||
success,
|
||||
actual ? null,
|
||||
expected ? null,
|
||||
} @ result:
|
||||
result // {msg = "${name}: ${msg}";})
|
||||
14
tix/test.nix
14
tix/test.nix
|
|
@ -1,14 +1,14 @@
|
|||
path: let
|
||||
it = import ./it.nix;
|
||||
describe = import ./describe.nix;
|
||||
suite = import path;
|
||||
in
|
||||
builtins.trace ("testing " + builtins.baseNameOf path)
|
||||
(
|
||||
if !builtins.isFunction suite
|
||||
then throw "A test suite should be in the form { it }: [ <tests> ]."
|
||||
else
|
||||
{
|
||||
inherit path;
|
||||
results = suite {inherit it;};
|
||||
}
|
||||
if !builtins.isFunction suite
|
||||
then throw "A test suite should be in the form { it }: [ <tests> ]."
|
||||
else {
|
||||
inherit path;
|
||||
results = suite {inherit it describe;};
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue