diff --git a/pkgs/build-support/testers/expect-failure.sh b/pkgs/build-support/testers/expect-failure.sh index 052ee8527176..9c725d48bf34 100644 --- a/pkgs/build-support/testers/expect-failure.sh +++ b/pkgs/build-support/testers/expect-failure.sh @@ -34,6 +34,15 @@ echo "testBuildFailure: Original builder produced exit code: $r" # ----------------------------------------- # Write the build log to the default output +# +# # from stdenv setup.sh +getAllOutputNames() { + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}" + else + echo "$outputs" + fi +} outs=( $(getAllOutputNames) ) defOut=${outs[0]} diff --git a/pkgs/build-support/testers/test/default.nix b/pkgs/build-support/testers/test/default.nix index 26e622c8763f..0a5381b2b738 100644 --- a/pkgs/build-support/testers/test/default.nix +++ b/pkgs/build-support/testers/test/default.nix @@ -58,9 +58,10 @@ lib.recurseIntoAttrs { inherit hello; } '' echo "Checking $failed/testBuildFailure.log" - grep -F 'testBuildFailure: The builder did not fail, but a failure was expected' $failed/testBuildFailure.log + grep -F 'testBuildFailure: The builder did not fail, but a failure was expected' $failed/testBuildFailure.log >/dev/null [[ 1 = $(cat $failed/testBuildFailure.exit) ]] touch $out + echo 'All good.' ''; multiOutput = runCommand "testBuildFailure-multiOutput" { diff --git a/pkgs/test/kernel.nix b/pkgs/test/kernel.nix index a4da10030332..2ccd188b1edb 100644 --- a/pkgs/test/kernel.nix +++ b/pkgs/test/kernel.nix @@ -27,15 +27,9 @@ let { NIXOS_FAKE_MMC_BLOCK_MINORS = freeform "64"; } # will trigger an error but the message is not great: ]; - yesWinsOverNoConfig = mkMerge [ - # default for "NIXOS_TEST_BOOLEAN" is no - { "NIXOS_TEST_BOOLEAN" = yes; } # yes wins over no by default - { "NIXOS_TEST_BOOLEAN" = no; } - ]; - - optionalNoWins = mkMerge [ - { NIXOS_FAKE_USB_DEBUG = option yes;} - { NIXOS_FAKE_USB_DEBUG = yes;} + mkDefaultWorksConfig = mkMerge [ + { "NIXOS_TEST_BOOLEAN" = yes; } + { "NIXOS_TEST_BOOLEAN" = lib.mkDefault no; } ]; allOptionalRemainOptional = mkMerge [ @@ -57,7 +51,7 @@ runTests { }; testYesWinsOverNo = { - expr = (getConfig yesWinsOverNoConfig)."NIXOS_TEST_BOOLEAN".tristate; + expr = (getConfig mkDefaultWorksConfig)."NIXOS_TEST_BOOLEAN".tristate; expected = "y"; };