Merge pull request #211260 from Artturin/testtweaks1
This commit is contained in:
commit
3653f4ece2
@ -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]}
|
||||
|
@ -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" {
|
||||
|
@ -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";
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user