lib/modules: Introduce _module.checks.*.check
Previously the .enable option was used to encode the condition as well, which lead to some oddness: - In order to encode an assertion, one had to invert it - To disable a check, one had to mkForce it By introducing a separate .check option this is solved because: - It can be used to encode assertions - Disabling is done separately with .enable option, whose default can be overridden without a mkForce
This commit is contained in:
@@ -279,7 +279,8 @@ checkConfigOutput baz config.value.nested.bar.baz ./types-anything/mk-mods.nix
|
||||
# Check that assertions are triggered by default for just evaluating config
|
||||
checkConfigError 'Failed checks:\n- \[test\] Assertion failed' config ./assertions/simple.nix
|
||||
|
||||
# Assertion is not triggered when enable is false
|
||||
# Assertion is not triggered when enable is false or condition is true
|
||||
checkConfigOutput '{ }' config ./assertions/condition-true.nix
|
||||
checkConfigOutput '{ }' config ./assertions/enable-false.nix
|
||||
|
||||
# Warnings should be displayed on standard error
|
||||
|
||||
Reference in New Issue
Block a user