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;
}