modules/test: add config and options passthrus

This should make inspection of tests a little easier.
This commit is contained in:
Matt Sturgeon 2024-08-24 20:03:45 +01:00
parent af31063538
commit 4814147442
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
config, config,
options,
lib, lib,
... ...
}: }:
@ -66,7 +67,20 @@ in
in in
{ {
test.derivation = 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 # First check warnings/assertions, then run nvim
lib.optionalString (errors != "") '' lib.optionalString (errors != "") ''