tix/flake.nix

42 lines
897 B
Nix
Raw Normal View History

2024-01-02 09:02:41 +00:00
{
description = "A testing library for nix";
2024-01-02 11:13:47 +00:00
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {inherit system;};
2024-01-02 12:44:07 +00:00
tix = import ./tix/. {inherit pkgs;};
2024-01-02 11:13:47 +00:00
in
2024-01-02 13:15:50 +00:00
tix
// {
2024-01-02 12:44:07 +00:00
packages.x86_64-linux.test = tix.run [
./test/it.test.nix
./test/test.test.nix
2024-01-02 13:15:50 +00:00
./test/describe.test.nix
2024-01-03 01:27:47 +00:00
./test/watch.test.nix
2024-01-02 12:44:07 +00:00
];
2024-01-03 06:47:16 +00:00
2024-01-02 12:44:07 +00:00
packages.x86_64-linux.example = tix.run [
./mytest.nix
];
2024-01-03 06:47:16 +00:00
2024-01-03 03:07:39 +00:00
packages.x86_64-linux.watch = tix.watch {
2024-01-03 06:47:16 +00:00
cmd = "nix run --show-trace .#test file";
view = "tee -a /tmp/tix-output";
2024-01-03 03:07:39 +00:00
};
2024-01-03 06:47:16 +00:00
packages.x86_64-linux.results = pkgs.writeShellScriptBin "results" ''
tail -f -n1 /tmp/tix-output | {
while read out
do
clear
jq '${tix.filters.overview}' $out
done
}
'';
2024-01-02 11:13:47 +00:00
};
2024-01-02 09:02:41 +00:00
}
2024-01-03 06:47:16 +00:00