mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-01 04:44:31 +02:00
flake-modules/devshell: update tests command with link-farm support
Since we're using link-farms, we need to access the underlying tests as `passthru.entries.*`.
This commit is contained in:
parent
69c2fa866e
commit
312db6b6e2
2 changed files with 40 additions and 5 deletions
|
@ -7,6 +7,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
self',
|
||||
system,
|
||||
...
|
||||
}:
|
||||
|
@ -44,9 +45,27 @@
|
|||
|
||||
text = builtins.readFile ./launch-test.sh;
|
||||
};
|
||||
|
||||
tests =
|
||||
let
|
||||
checks' = self'.checks;
|
||||
names = builtins.filter (n: builtins.match "test-.*" n != null) (builtins.attrNames checks');
|
||||
in
|
||||
builtins.listToAttrs (
|
||||
builtins.concatMap (
|
||||
checkName:
|
||||
map (testName: {
|
||||
name = testName;
|
||||
value = "${checkName}.passthru.entries.${testName}";
|
||||
}) (builtins.attrNames checks'.${checkName}.passthru.entries)
|
||||
) names
|
||||
);
|
||||
in
|
||||
''
|
||||
NIXVIM_SYSTEM=${system} NIXVIM_NIX_COMMAND=${nix} ${lib.getExe launchTest} "$@"
|
||||
export NIXVIM_SYSTEM=${system}
|
||||
export NIXVIM_NIX_COMMAND=${nix}
|
||||
export NIXVIM_TESTS=${pkgs.writers.writeJSON "tests.json" tests}
|
||||
${lib.getExe launchTest} "$@"
|
||||
'';
|
||||
}
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue