lib/tests: Add tests for recursive disabledModules

This commit is contained in:
Silvan Mosberger 2020-01-04 02:01:21 +01:00
parent 7167985e34
commit b89b23b6b2
No known key found for this signature in database
GPG key ID: E8F1E9EAD284E17D
6 changed files with 38 additions and 0 deletions

View file

@ -182,6 +182,12 @@ checkConfigOutput "true" config.submodule.outer ./declare-submoduleWith-modules.
## Paths should be allowed as values and work as expected
checkConfigOutput "true" config.submodule.enable ./declare-submoduleWith-path.nix
# Check that disabledModules works recursively and correctly
checkConfigOutput "true" config.enable ./disable-recursive/main.nix
checkConfigOutput "true" config.enable ./disable-recursive/{main.nix,disable-foo.nix}
checkConfigOutput "true" config.enable ./disable-recursive/{main.nix,disable-bar.nix}
checkConfigError 'The option .* defined in .* does not exist' config.enable ./disable-recursive/{main.nix,disable-foo.nix,disable-bar.nix}
cat <<EOF
====== module tests ======
$pass Pass

View file

@ -0,0 +1,5 @@
{
imports = [
../declare-enable.nix
];
}

View file

@ -0,0 +1,7 @@
{
disabledModules = [
./bar.nix
];
}

View file

@ -0,0 +1,7 @@
{
disabledModules = [
./foo.nix
];
}

View file

@ -0,0 +1,5 @@
{
imports = [
../declare-enable.nix
];
}

View file

@ -0,0 +1,8 @@
{
imports = [
./foo.nix
./bar.nix
];
enable = true;
}