diff options
| author | Johannes Kirschbauer <hsjobeki@gmail.com> | 2026-01-08 11:01:37 +0100 |
|---|---|---|
| committer | Johannes Kirschbauer <hsjobeki@gmail.com> | 2026-01-20 21:26:05 +0100 |
| commit | 53b47eb93dfdf0f3d848920d18202a3febe3caf7 (patch) | |
| tree | 6911b82ecac14fa7717f4b6d0a8cdca1ea426414 /lib | |
| parent | lib/types: add types.{json,toml} from pkgs.formats (diff) | |
| download | nixpkgs-53b47eb93dfdf0f3d848920d18202a3febe3caf7.tar.gz | |
lib/tests: add strict option to checkConfigOutput
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/tests/modules.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index 8ea8adab72c9..68645394e314 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -58,12 +58,19 @@ logFailure() { evalConfig() { local attr=$1 shift - local script="import ./default.nix { modules = [ $* ];}" + + local nix_args=() + if [ "${ABORT_ON_WARN-0}" = "1" ]; then - local-nix-instantiate --option abort-on-warn true -E "$script" -A "$attr" - else - local-nix-instantiate -E "$script" -A "$attr" + nix_args+=(--option abort-on-warn true) fi + + if [ "${STRICT_EVAL-0}" = "1" ]; then + nix_args+=(--strict) + fi + + local script="import ./default.nix { modules = [ $* ];}" + local-nix-instantiate "${nix_args[@]}" -E "$script" -A "$attr" } reportFailure() { |
