tix/testing/run.nix

16 lines
445 B
Nix
Raw Normal View History

2024-01-02 11:13:47 +00:00
pkgs: files: let
2024-01-02 09:02:41 +00:00
test = import ./import.nix;
res = map test files;
resFile = builtins.toFile "results" (builtins.toJSON res);
filter = ''
.[] | {
(.path): {
failures: [.results | map(select(.success==false))[] | {(.msg): {actual, expected}}],
success: .results | map(select(.success) | .msg) | length
}
}
'';
in (pkgs.writeShellScriptBin "test" ''
2024-01-02 10:51:57 +00:00
cat '${resFile}' | ${pkgs.jq}/bin/jq '${filter}'
2024-01-02 09:02:41 +00:00
'')