dev: Make the tests command able to select which test to launch

The `tests` command can either launch all tests (without any arguments),
a specific test with `-t/--test` or choose a test with `-i/--interactive`
This commit is contained in:
traxys 2024-07-20 00:18:36 +02:00
parent b1576362a7
commit 7908729711
4 changed files with 99 additions and 5 deletions

View file

@ -32,11 +32,21 @@
{
name = "tests";
help = "Run nixvim tests";
command = ''
echo "=> Running nixvim tests for the '${system}' architecture..."
command =
let
launchTest = pkgs.writeShellApplication {
name = "launch-tests";
runtimeInputs = with pkgs; [
jq
fzf
];
${nix} build .#checks.${system}.tests "$@"
'';
text = builtins.readFile ./launch-test.sh;
};
in
''
NIXVIM_SYSTEM=${system} NIXVIM_NIX_COMMAND=${nix} ${lib.getExe launchTest} "$@"
'';
}
{
name = "test-lib";