Unverified Commit 53b47eb9 authored by Johannes Kirschbauer's avatar Johannes Kirschbauer
Browse files

lib/tests: add strict option to checkConfigOutput

parent c988f82f
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -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() {