at 23.05-pre 23 kB view raw
1#!/usr/bin/env bash 2# 3# This script is used to test that the module system is working as expected. 4# By default it test the version of nixpkgs which is defined in the NIX_PATH. 5 6set -o errexit -o noclobber -o nounset -o pipefail 7shopt -s failglob inherit_errexit 8 9# https://stackoverflow.com/a/246128/6605742 10DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 11 12cd "$DIR"/modules 13 14pass=0 15fail=0 16 17evalConfig() { 18 local attr=$1 19 shift 20 local script="import ./default.nix { modules = [ $* ];}" 21 nix-instantiate --timeout 1 -E "$script" -A "$attr" --eval-only --show-trace --read-write-mode 22} 23 24reportFailure() { 25 local attr=$1 26 shift 27 local script="import ./default.nix { modules = [ $* ];}" 28 echo 2>&1 "$ nix-instantiate -E '$script' -A '$attr' --eval-only" 29 evalConfig "$attr" "$@" || true 30 ((++fail)) 31} 32 33checkConfigOutput() { 34 local outputContains=$1 35 shift 36 if evalConfig "$@" 2>/dev/null | grep --silent "$outputContains" ; then 37 ((++pass)) 38 else 39 echo 2>&1 "error: Expected result matching '$outputContains', while evaluating" 40 reportFailure "$@" 41 fi 42} 43 44checkConfigError() { 45 local errorContains=$1 46 local err="" 47 shift 48 if err="$(evalConfig "$@" 2>&1 >/dev/null)"; then 49 echo 2>&1 "error: Expected error code, got exit code 0, while evaluating" 50 reportFailure "$@" 51 else 52 if echo "$err" | grep -zP --silent "$errorContains" ; then 53 ((++pass)) 54 else 55 echo 2>&1 "error: Expected error matching '$errorContains', while evaluating" 56 reportFailure "$@" 57 fi 58 fi 59} 60 61# Shorthand meta attribute does not duplicate the config 62checkConfigOutput '^"one two"$' config.result ./shorthand-meta.nix 63 64# Check boolean option. 65checkConfigOutput '^false$' config.enable ./declare-enable.nix 66checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*: true' config.enable ./define-enable.nix 67 68checkConfigOutput '^1$' config.bare-submodule.nested ./declare-bare-submodule.nix ./declare-bare-submodule-nested-option.nix 69checkConfigOutput '^2$' config.bare-submodule.deep ./declare-bare-submodule.nix ./declare-bare-submodule-deep-option.nix 70checkConfigOutput '^42$' config.bare-submodule.nested ./declare-bare-submodule.nix ./declare-bare-submodule-nested-option.nix ./declare-bare-submodule-deep-option.nix ./define-bare-submodule-values.nix 71checkConfigOutput '^420$' config.bare-submodule.deep ./declare-bare-submodule.nix ./declare-bare-submodule-nested-option.nix ./declare-bare-submodule-deep-option.nix ./define-bare-submodule-values.nix 72checkConfigOutput '^2$' config.bare-submodule.deep ./declare-bare-submodule.nix ./declare-bare-submodule-deep-option.nix ./define-shorthandOnlyDefinesConfig-true.nix 73checkConfigError 'The option .bare-submodule.deep. in .*/declare-bare-submodule-deep-option.nix. is already declared in .*/declare-bare-submodule-deep-option-duplicate.nix' config.bare-submodule.deep ./declare-bare-submodule.nix ./declare-bare-submodule-deep-option.nix ./declare-bare-submodule-deep-option-duplicate.nix 74 75# Check integer types. 76# unsigned 77checkConfigOutput '^42$' config.value ./declare-int-unsigned-value.nix ./define-value-int-positive.nix 78checkConfigError 'A definition for option .* is not of type.*unsigned integer.*. Definition values:\n\s*- In .*: -23' config.value ./declare-int-unsigned-value.nix ./define-value-int-negative.nix 79# positive 80checkConfigError 'A definition for option .* is not of type.*positive integer.*. Definition values:\n\s*- In .*: 0' config.value ./declare-int-positive-value.nix ./define-value-int-zero.nix 81# between 82checkConfigOutput '^42$' config.value ./declare-int-between-value.nix ./define-value-int-positive.nix 83checkConfigError 'A definition for option .* is not of type.*between.*-21 and 43.*inclusive.*. Definition values:\n\s*- In .*: -23' config.value ./declare-int-between-value.nix ./define-value-int-negative.nix 84 85# Check either types 86# types.either 87checkConfigOutput '^42$' config.value ./declare-either.nix ./define-value-int-positive.nix 88checkConfigOutput '^"24"$' config.value ./declare-either.nix ./define-value-string.nix 89# types.oneOf 90checkConfigOutput '^42$' config.value ./declare-oneOf.nix ./define-value-int-positive.nix 91checkConfigOutput '^\[ \]$' config.value ./declare-oneOf.nix ./define-value-list.nix 92checkConfigOutput '^"24"$' config.value ./declare-oneOf.nix ./define-value-string.nix 93 94# Check mkForce without submodules. 95set -- config.enable ./declare-enable.nix ./define-enable.nix 96checkConfigOutput '^true$' "$@" 97checkConfigOutput '^false$' "$@" ./define-force-enable.nix 98checkConfigOutput '^false$' "$@" ./define-enable-force.nix 99 100# Check mkForce with option and submodules. 101checkConfigError 'attribute .*foo.* .* not found' config.attrsOfSub.foo.enable ./declare-attrsOfSub-any-enable.nix 102checkConfigOutput '^false$' config.attrsOfSub.foo.enable ./declare-attrsOfSub-any-enable.nix ./define-attrsOfSub-foo.nix 103set -- config.attrsOfSub.foo.enable ./declare-attrsOfSub-any-enable.nix ./define-attrsOfSub-foo-enable.nix 104checkConfigOutput '^true$' "$@" 105checkConfigOutput '^false$' "$@" ./define-force-attrsOfSub-foo-enable.nix 106checkConfigOutput '^false$' "$@" ./define-attrsOfSub-force-foo-enable.nix 107checkConfigOutput '^false$' "$@" ./define-attrsOfSub-foo-force-enable.nix 108checkConfigOutput '^false$' "$@" ./define-attrsOfSub-foo-enable-force.nix 109 110# Check overriding effect of mkForce on submodule definitions. 111checkConfigError 'attribute .*bar.* .* not found' config.attrsOfSub.bar.enable ./declare-attrsOfSub-any-enable.nix ./define-attrsOfSub-foo.nix 112checkConfigOutput '^false$' config.attrsOfSub.bar.enable ./declare-attrsOfSub-any-enable.nix ./define-attrsOfSub-foo.nix ./define-attrsOfSub-bar.nix 113set -- config.attrsOfSub.bar.enable ./declare-attrsOfSub-any-enable.nix ./define-attrsOfSub-foo.nix ./define-attrsOfSub-bar-enable.nix 114checkConfigOutput '^true$' "$@" 115checkConfigError 'attribute .*bar.* .* not found' "$@" ./define-force-attrsOfSub-foo-enable.nix 116checkConfigError 'attribute .*bar.* .* not found' "$@" ./define-attrsOfSub-force-foo-enable.nix 117checkConfigOutput '^true$' "$@" ./define-attrsOfSub-foo-force-enable.nix 118checkConfigOutput '^true$' "$@" ./define-attrsOfSub-foo-enable-force.nix 119 120# Check mkIf with submodules. 121checkConfigError 'attribute .*foo.* .* not found' config.attrsOfSub.foo.enable ./declare-enable.nix ./declare-attrsOfSub-any-enable.nix 122set -- config.attrsOfSub.foo.enable ./declare-enable.nix ./declare-attrsOfSub-any-enable.nix 123checkConfigError 'attribute .*foo.* .* not found' "$@" ./define-if-attrsOfSub-foo-enable.nix 124checkConfigError 'attribute .*foo.* .* not found' "$@" ./define-attrsOfSub-if-foo-enable.nix 125checkConfigError 'attribute .*foo.* .* not found' "$@" ./define-attrsOfSub-foo-if-enable.nix 126checkConfigOutput '^false$' "$@" ./define-attrsOfSub-foo-enable-if.nix 127checkConfigOutput '^true$' "$@" ./define-enable.nix ./define-if-attrsOfSub-foo-enable.nix 128checkConfigOutput '^true$' "$@" ./define-enable.nix ./define-attrsOfSub-if-foo-enable.nix 129checkConfigOutput '^true$' "$@" ./define-enable.nix ./define-attrsOfSub-foo-if-enable.nix 130checkConfigOutput '^true$' "$@" ./define-enable.nix ./define-attrsOfSub-foo-enable-if.nix 131 132# Check disabledModules with config definitions and option declarations. 133set -- config.enable ./define-enable.nix ./declare-enable.nix 134checkConfigOutput '^true$' "$@" 135checkConfigOutput '^false$' "$@" ./disable-define-enable.nix 136checkConfigOutput '^false$' "$@" ./disable-define-enable-string-path.nix 137checkConfigError "The option .*enable.* does not exist. Definition values:\n\s*- In .*: true" "$@" ./disable-declare-enable.nix 138checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-define-enable.nix ./disable-declare-enable.nix 139checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-enable-modules.nix 140 141# Check _module.args. 142set -- config.enable ./declare-enable.nix ./define-enable-with-custom-arg.nix 143checkConfigError 'while evaluating the module argument .*custom.* in .*define-enable-with-custom-arg.nix.*:' "$@" 144checkConfigOutput '^true$' "$@" ./define-_module-args-custom.nix 145 146# Check that using _module.args on imports cause infinite recursions, with 147# the proper error context. 148set -- "$@" ./define-_module-args-custom.nix ./import-custom-arg.nix 149checkConfigError 'while evaluating the module argument .*custom.* in .*import-custom-arg.nix.*:' "$@" 150checkConfigError 'infinite recursion encountered' "$@" 151 152# Check _module.check. 153set -- config.enable ./declare-enable.nix ./define-enable.nix ./define-attrsOfSub-foo.nix 154checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*' "$@" 155checkConfigOutput '^true$' "$@" ./define-module-check.nix 156 157# Check coerced value. 158checkConfigOutput '^"42"$' config.value ./declare-coerced-value.nix 159checkConfigOutput '^"24"$' config.value ./declare-coerced-value.nix ./define-value-string.nix 160checkConfigError 'A definition for option .* is not.*string or signed integer convertible to it.*. Definition values:\n\s*- In .*: \[ \]' config.value ./declare-coerced-value.nix ./define-value-list.nix 161 162# Check coerced value with unsound coercion 163checkConfigOutput '^12$' config.value ./declare-coerced-value-unsound.nix 164checkConfigError 'A definition for option .* is not of type .*. Definition values:\n\s*- In .*: "1000"' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix 165checkConfigError 'toInt: Could not convert .* to int' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix 166 167# Check mkAliasOptionModule. 168checkConfigOutput '^true$' config.enable ./alias-with-priority.nix 169checkConfigOutput '^true$' config.enableAlias ./alias-with-priority.nix 170checkConfigOutput '^false$' config.enable ./alias-with-priority-can-override.nix 171checkConfigOutput '^false$' config.enableAlias ./alias-with-priority-can-override.nix 172 173# submoduleWith 174 175## specialArgs should work 176checkConfigOutput '^"foo"$' config.submodule.foo ./declare-submoduleWith-special.nix 177 178## shorthandOnlyDefines config behaves as expected 179checkConfigOutput '^true$' config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-shorthand.nix 180checkConfigError 'is not of type `boolean' config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-noshorthand.nix 181checkConfigError "You're trying to declare a value of type \`bool'\n\s*rather than an attribute-set for the option" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-shorthand.nix 182checkConfigOutput '^true$' config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-noshorthand.nix 183 184## submoduleWith should merge all modules in one swoop 185checkConfigOutput '^true$' config.submodule.inner ./declare-submoduleWith-modules.nix 186checkConfigOutput '^true$' config.submodule.outer ./declare-submoduleWith-modules.nix 187# Should also be able to evaluate the type name (which evaluates freeformType, 188# which evaluates all the modules defined by the type) 189checkConfigOutput '^"submodule"$' options.submodule.type.description ./declare-submoduleWith-modules.nix 190 191## submodules can be declared using (evalModules {...}).type 192checkConfigOutput '^true$' config.submodule.inner ./declare-submodule-via-evalModules.nix 193checkConfigOutput '^true$' config.submodule.outer ./declare-submodule-via-evalModules.nix 194# Should also be able to evaluate the type name (which evaluates freeformType, 195# which evaluates all the modules defined by the type) 196checkConfigOutput '^"submodule"$' options.submodule.type.description ./declare-submodule-via-evalModules.nix 197 198## Paths should be allowed as values and work as expected 199checkConfigOutput '^true$' config.submodule.enable ./declare-submoduleWith-path.nix 200 201## deferredModule 202# default module is merged into nodes.foo 203checkConfigOutput '"beta"' config.nodes.foo.settingsDict.c ./deferred-module.nix 204# errors from the default module are reported with accurate location 205checkConfigError 'In `the-file-that-contains-the-bad-config.nix, via option default'\'': "bogus"' config.nodes.foo.bottom ./deferred-module.nix 206checkConfigError '.*lib/tests/modules/deferred-module-error.nix, via option deferred [(]:anon-1:anon-1:anon-1[)] does not look like a module.' config.result ./deferred-module-error.nix 207 208# Check the file location information is propagated into submodules 209checkConfigOutput the-file.nix config.submodule.internalFiles.0 ./submoduleFiles.nix 210 211 212# Check that disabledModules works recursively and correctly 213checkConfigOutput '^true$' config.enable ./disable-recursive/main.nix 214checkConfigOutput '^true$' config.enable ./disable-recursive/{main.nix,disable-foo.nix} 215checkConfigOutput '^true$' config.enable ./disable-recursive/{main.nix,disable-bar.nix} 216checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*: true' config.enable ./disable-recursive/{main.nix,disable-foo.nix,disable-bar.nix} 217 218# Check that imports can depend on derivations 219checkConfigOutput '^true$' config.enable ./import-from-store.nix 220 221# Check that configs can be conditional on option existence 222checkConfigOutput '^true$' config.enable ./define-option-dependently.nix ./declare-enable.nix ./declare-int-positive-value.nix 223checkConfigOutput '^360$' config.value ./define-option-dependently.nix ./declare-enable.nix ./declare-int-positive-value.nix 224checkConfigOutput '^7$' config.value ./define-option-dependently.nix ./declare-int-positive-value.nix 225checkConfigOutput '^true$' config.set.enable ./define-option-dependently-nested.nix ./declare-enable-nested.nix ./declare-int-positive-value-nested.nix 226checkConfigOutput '^360$' config.set.value ./define-option-dependently-nested.nix ./declare-enable-nested.nix ./declare-int-positive-value-nested.nix 227checkConfigOutput '^7$' config.set.value ./define-option-dependently-nested.nix ./declare-int-positive-value-nested.nix 228 229# Check attrsOf and lazyAttrsOf. Only lazyAttrsOf should be lazy, and only 230# attrsOf should work with conditional definitions 231# In addition, lazyAttrsOf should honor an options emptyValue 232checkConfigError "is not lazy" config.isLazy ./declare-attrsOf.nix ./attrsOf-lazy-check.nix 233checkConfigOutput '^true$' config.isLazy ./declare-lazyAttrsOf.nix ./attrsOf-lazy-check.nix 234checkConfigOutput '^true$' config.conditionalWorks ./declare-attrsOf.nix ./attrsOf-conditional-check.nix 235checkConfigOutput '^false$' config.conditionalWorks ./declare-lazyAttrsOf.nix ./attrsOf-conditional-check.nix 236checkConfigOutput '^"empty"$' config.value.foo ./declare-lazyAttrsOf.nix ./attrsOf-conditional-check.nix 237 238 239# Even with multiple assignments, a type error should be thrown if any of them aren't valid 240checkConfigError 'A definition for option .* is not of type .*' \ 241 config.value ./declare-int-unsigned-value.nix ./define-value-list.nix ./define-value-int-positive.nix 242 243## Freeform modules 244# Assigning without a declared option should work 245checkConfigOutput '^"24"$' config.value ./freeform-attrsOf.nix ./define-value-string.nix 246# No freeform assigments shouldn't make it error 247checkConfigOutput '^{ }$' config ./freeform-attrsOf.nix 248# but only if the type matches 249checkConfigError 'A definition for option .* is not of type .*' config.value ./freeform-attrsOf.nix ./define-value-list.nix 250# and properties should be applied 251checkConfigOutput '^"yes"$' config.value ./freeform-attrsOf.nix ./define-value-string-properties.nix 252# Options should still be declarable, and be able to have a type that doesn't match the freeform type 253checkConfigOutput '^false$' config.enable ./freeform-attrsOf.nix ./define-value-string.nix ./declare-enable.nix 254checkConfigOutput '^"24"$' config.value ./freeform-attrsOf.nix ./define-value-string.nix ./declare-enable.nix 255# and this should work too with nested values 256checkConfigOutput '^false$' config.nest.foo ./freeform-attrsOf.nix ./freeform-nested.nix 257checkConfigOutput '^"bar"$' config.nest.bar ./freeform-attrsOf.nix ./freeform-nested.nix 258# Check whether a declared option can depend on an freeform-typed one 259checkConfigOutput '^null$' config.foo ./freeform-attrsOf.nix ./freeform-str-dep-unstr.nix 260checkConfigOutput '^"24"$' config.foo ./freeform-attrsOf.nix ./freeform-str-dep-unstr.nix ./define-value-string.nix 261# Check whether an freeform-typed value can depend on a declared option, this can only work with lazyAttrsOf 262checkConfigError 'infinite recursion encountered' config.foo ./freeform-attrsOf.nix ./freeform-unstr-dep-str.nix 263checkConfigError 'The option .* is used but not defined' config.foo ./freeform-lazyAttrsOf.nix ./freeform-unstr-dep-str.nix 264checkConfigOutput '^"24"$' config.foo ./freeform-lazyAttrsOf.nix ./freeform-unstr-dep-str.nix ./define-value-string.nix 265# submodules in freeformTypes should have their locations annotated 266checkConfigOutput '/freeform-submodules.nix"$' config.fooDeclarations.0 ./freeform-submodules.nix 267# freeformTypes can get merged using `types.type`, including submodules 268checkConfigOutput '^10$' config.free.xxx.foo ./freeform-submodules.nix 269checkConfigOutput '^10$' config.free.yyy.bar ./freeform-submodules.nix 270 271## types.anything 272# Check that attribute sets are merged recursively 273checkConfigOutput '^null$' config.value.foo ./types-anything/nested-attrs.nix 274checkConfigOutput '^null$' config.value.l1.foo ./types-anything/nested-attrs.nix 275checkConfigOutput '^null$' config.value.l1.l2.foo ./types-anything/nested-attrs.nix 276checkConfigOutput '^null$' config.value.l1.l2.l3.foo ./types-anything/nested-attrs.nix 277# Attribute sets that are coercible to strings shouldn't be recursed into 278checkConfigOutput '^"foo"$' config.value.outPath ./types-anything/attrs-coercible.nix 279# Multiple lists aren't concatenated together 280checkConfigError 'The option .* has conflicting definitions' config.value ./types-anything/lists.nix 281# Check that all equalizable atoms can be used as long as all definitions are equal 282checkConfigOutput '^0$' config.value.int ./types-anything/equal-atoms.nix 283checkConfigOutput '^false$' config.value.bool ./types-anything/equal-atoms.nix 284checkConfigOutput '^""$' config.value.string ./types-anything/equal-atoms.nix 285checkConfigOutput '^/$' config.value.path ./types-anything/equal-atoms.nix 286checkConfigOutput '^null$' config.value.null ./types-anything/equal-atoms.nix 287checkConfigOutput '^0.1$' config.value.float ./types-anything/equal-atoms.nix 288# Functions can't be merged together 289checkConfigError "The option .value.multiple-lambdas.<function body>. has conflicting option types" config.applied.multiple-lambdas ./types-anything/functions.nix 290checkConfigOutput '^<LAMBDA>$' config.value.single-lambda ./types-anything/functions.nix 291checkConfigOutput '^null$' config.applied.merging-lambdas.x ./types-anything/functions.nix 292checkConfigOutput '^null$' config.applied.merging-lambdas.y ./types-anything/functions.nix 293# Check that all mk* modifiers are applied 294checkConfigError 'attribute .* not found' config.value.mkiffalse ./types-anything/mk-mods.nix 295checkConfigOutput '^{ }$' config.value.mkiftrue ./types-anything/mk-mods.nix 296checkConfigOutput '^1$' config.value.mkdefault ./types-anything/mk-mods.nix 297checkConfigOutput '^{ }$' config.value.mkmerge ./types-anything/mk-mods.nix 298checkConfigOutput '^true$' config.value.mkbefore ./types-anything/mk-mods.nix 299checkConfigOutput '^1$' config.value.nested.foo ./types-anything/mk-mods.nix 300checkConfigOutput '^"baz"$' config.value.nested.bar.baz ./types-anything/mk-mods.nix 301 302## types.functionTo 303checkConfigOutput '^"input is input"$' config.result ./functionTo/trivial.nix 304checkConfigOutput '^"a b"$' config.result ./functionTo/merging-list.nix 305checkConfigError 'A definition for option .fun.<function body>. is not of type .string.. Definition values:\n\s*- In .*wrong-type.nix' config.result ./functionTo/wrong-type.nix 306checkConfigOutput '^"b a"$' config.result ./functionTo/list-order.nix 307checkConfigOutput '^"a c"$' config.result ./functionTo/merging-attrs.nix 308checkConfigOutput '^"a bee"$' config.result ./functionTo/submodule-options.nix 309checkConfigOutput '^"fun.<function body>.a fun.<function body>.b"$' config.optionsResult ./functionTo/submodule-options.nix 310 311# moduleType 312checkConfigOutput '^"a b"$' config.resultFoo ./declare-variants.nix ./define-variant.nix 313checkConfigOutput '^"a b y z"$' config.resultFooBar ./declare-variants.nix ./define-variant.nix 314checkConfigOutput '^"a b c"$' config.resultFooFoo ./declare-variants.nix ./define-variant.nix 315 316## emptyValue's 317checkConfigOutput "[ ]" config.list.a ./emptyValues.nix 318checkConfigOutput "{ }" config.attrs.a ./emptyValues.nix 319checkConfigOutput "null" config.null.a ./emptyValues.nix 320checkConfigOutput "{ }" config.submodule.a ./emptyValues.nix 321# These types don't have empty values 322checkConfigError 'The option .int.a. is used but not defined' config.int.a ./emptyValues.nix 323checkConfigError 'The option .nonEmptyList.a. is used but not defined' config.nonEmptyList.a ./emptyValues.nix 324 325## types.raw 326checkConfigOutput "{ foo = <CODE>; }" config.unprocessedNesting ./raw.nix 327checkConfigOutput "10" config.processedToplevel ./raw.nix 328checkConfigError "The option .multiple. is defined multiple times" config.multiple ./raw.nix 329checkConfigOutput "bar" config.priorities ./raw.nix 330 331## Option collision 332checkConfigError \ 333 'The option .set. in module .*/declare-set.nix. would be a parent of the following options, but its type .attribute set of signed integer. does not support nested options.\n\s*- option[(]s[)] with prefix .set.enable. in module .*/declare-enable-nested.nix.' \ 334 config.set \ 335 ./declare-set.nix ./declare-enable-nested.nix 336 337# Test that types.optionType merges types correctly 338checkConfigOutput '^10$' config.theOption.int ./optionTypeMerging.nix 339checkConfigOutput '^"hello"$' config.theOption.str ./optionTypeMerging.nix 340 341# Test that types.optionType correctly annotates option locations 342checkConfigError 'The option .theOption.nested. in .other.nix. is already declared in .optionTypeFile.nix.' config.theOption.nested ./optionTypeFile.nix 343 344# Test that types.optionType leaves types untouched as long as they don't need to be merged 345checkConfigOutput 'ok' config.freeformItems.foo.bar ./adhoc-freeformType-survives-type-merge.nix 346 347# Anonymous submodules don't get nixed by import resolution/deduplication 348# because of an `extendModules` bug, issue 168767. 349checkConfigOutput '^1$' config.sub.specialisation.value ./extendModules-168767-imports.nix 350 351# doRename works when `warnings` does not exist. 352checkConfigOutput '^1234$' config.c.d.e ./doRename-basic.nix 353# doRename adds a warning. 354checkConfigOutput '^"The option `a\.b. defined in `.*/doRename-warnings\.nix. has been renamed to `c\.d\.e.\."$' \ 355 config.result \ 356 ./doRename-warnings.nix 357 358cat <<EOF 359====== module tests ====== 360$pass Pass 361$fail Fail 362EOF 363 364if [ "$fail" -ne 0 ]; then 365 exit 1 366fi 367exit 0