mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
lib/tests: Add tests for recursive disabledModules
This commit is contained in:
parent
7167985e34
commit
b89b23b6b2
@ -182,6 +182,12 @@ checkConfigOutput "true" config.submodule.outer ./declare-submoduleWith-modules.
|
|||||||
## Paths should be allowed as values and work as expected
|
## Paths should be allowed as values and work as expected
|
||||||
checkConfigOutput "true" config.submodule.enable ./declare-submoduleWith-path.nix
|
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
|
cat <<EOF
|
||||||
====== module tests ======
|
====== module tests ======
|
||||||
$pass Pass
|
$pass Pass
|
||||||
|
5
lib/tests/modules/disable-recursive/bar.nix
Normal file
5
lib/tests/modules/disable-recursive/bar.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../declare-enable.nix
|
||||||
|
];
|
||||||
|
}
|
7
lib/tests/modules/disable-recursive/disable-bar.nix
Normal file
7
lib/tests/modules/disable-recursive/disable-bar.nix
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
disabledModules = [
|
||||||
|
./bar.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
7
lib/tests/modules/disable-recursive/disable-foo.nix
Normal file
7
lib/tests/modules/disable-recursive/disable-foo.nix
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
disabledModules = [
|
||||||
|
./foo.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
5
lib/tests/modules/disable-recursive/foo.nix
Normal file
5
lib/tests/modules/disable-recursive/foo.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../declare-enable.nix
|
||||||
|
];
|
||||||
|
}
|
8
lib/tests/modules/disable-recursive/main.nix
Normal file
8
lib/tests/modules/disable-recursive/main.nix
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./foo.nix
|
||||||
|
./bar.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
enable = true;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user