summary refs log tree commit diff
path: root/lib/tests/modules.sh
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-02-14 23:18:44 +0100
committerVladimír Čunát <vcunat@gmail.com>2017-03-03 13:45:22 +0100
commitd88721e4408988202a0ae3cea3f5551ebfa13168 (patch)
tree5eca06d1133b1615b7c6e667ba7c42f7e97548b3 /lib/tests/modules.sh
parentbb9a37a2a56249483cd98ef09c254b78e736af1a (diff)
downloadnixpkgs-d88721e4408988202a0ae3cea3f5551ebfa13168.tar
nixpkgs-d88721e4408988202a0ae3cea3f5551ebfa13168.tar.gz
nixpkgs-d88721e4408988202a0ae3cea3f5551ebfa13168.tar.bz2
nixpkgs-d88721e4408988202a0ae3cea3f5551ebfa13168.tar.lz
nixpkgs-d88721e4408988202a0ae3cea3f5551ebfa13168.tar.xz
nixpkgs-d88721e4408988202a0ae3cea3f5551ebfa13168.tar.zst
nixpkgs-d88721e4408988202a0ae3cea3f5551ebfa13168.zip
modules: add support for module replacement with disabledModules
This is based on a prototype Nicolas B. Pierron worked on during a
discussion we had at FOSDEM.

A new version with a workaround for problems of the reverted original.
Discussion: https://github.com/NixOS/nixpkgs/commit/3f2566689
Diffstat (limited to 'lib/tests/modules.sh')
-rwxr-xr-xlib/tests/modules.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh
index 8b476a5d3dc..ba0c67fb7d4 100755
--- a/lib/tests/modules.sh
+++ b/lib/tests/modules.sh
@@ -99,6 +99,14 @@ checkConfigOutput 'true' "$@" ./define-enable.nix ./define-loaOfSub-if-foo-enabl
 checkConfigOutput 'true' "$@" ./define-enable.nix ./define-loaOfSub-foo-if-enable.nix
 checkConfigOutput 'true' "$@" ./define-enable.nix ./define-loaOfSub-foo-enable-if.nix
 
+# Check disabledModules with config definitions and option declarations.
+set -- config.enable ./define-enable.nix ./declare-enable.nix
+checkConfigOutput "true" "$@"
+checkConfigOutput "false" "$@" ./disable-define-enable.nix
+checkConfigError "The option .*enable.* defined in .* does not exist" "$@" ./disable-declare-enable.nix
+checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-define-enable.nix ./disable-declare-enable.nix
+checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-enable-modules.nix
+
 # Check _module.args.
 set -- config.enable ./declare-enable.nix ./define-enable-with-custom-arg.nix
 checkConfigError 'while evaluating the module argument .*custom.* in .*define-enable-with-custom-arg.nix.*:' "$@"