Skip to content

Commit

Permalink
modules/test: add config and options passthrus
Browse files Browse the repository at this point in the history
This should make inspection of tests a little easier.
  • Loading branch information
MattSturgeon committed Aug 27, 2024
1 parent af31063 commit 4814147
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion modules/top-level/test.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
pkgs,
config,
options,
lib,
...
}:
Expand Down Expand Up @@ -66,7 +67,20 @@ in
in
{
test.derivation =
pkgs.runCommandNoCCLocal cfg.name { nativeBuildInputs = [ config.finalPackage ]; }
pkgs.runCommandNoCCLocal cfg.name
{
nativeBuildInputs = [ config.finalPackage ];

# Allow inspecting the test's module a little from the repl
# e.g.
# :lf .
# :p checks.x86_64-linux.test-1.passthru.entries.modules-autocmd.passthru.entries.example.passthru.config.extraConfigLua
#
# Yes, three levels of passthru is cursed.
passthru = {
inherit config options;
};
}
(
# First check warnings/assertions, then run nvim
lib.optionalString (errors != "") ''
Expand Down

0 comments on commit 4814147

Please sign in to comment.