diff --git a/pkgs/build-support/testers/shellcheck/tests.nix b/pkgs/build-support/testers/shellcheck/tests.nix index 02044aea0f9c..bffe774bc1d7 100644 --- a/pkgs/build-support/testers/shellcheck/tests.nix +++ b/pkgs/build-support/testers/shellcheck/tests.nix @@ -4,41 +4,33 @@ { lib, testers, - runCommand, }: lib.recurseIntoAttrs { - - example-dir = - runCommand "test-testers-shellcheck-example-dir" - { - failure = testers.testBuildFailure ( - testers.shellcheck { - name = "shellcheck-example-dir"; - src = ./src; - } - ); - } + example-dir = testers.testBuildFailure' { + drv = testers.shellcheck { + name = "example-dir"; + src = ./src; + }; + expectedBuilderExitCode = 123; + expectedBuilderLogEntries = [ '' - log="$failure/testBuildFailure.log" - echo "Checking $log" - grep SC2068 "$log" - touch $out - ''; - - example-file = - runCommand "test-testers-shellcheck-example-file" - { - failure = testers.testBuildFailure ( - testers.shellcheck { - name = "shellcheck-example-file"; - src = ./src/example.sh; - } - ); - } + echo $@ + ^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements. '' - log="$failure/testBuildFailure.log" - echo "Checking $log" - grep SC2068 "$log" - touch $out - ''; + ]; + }; + + example-file = testers.testBuildFailure' { + drv = testers.shellcheck { + name = "example-file"; + src = ./src/example.sh; + }; + expectedBuilderExitCode = 123; + expectedBuilderLogEntries = [ + '' + echo $@ + ^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements. + '' + ]; + }; }