stdenv.tests: Add succeedOnFailure

This commit is contained in:
Robert Hensing 2022-11-14 19:03:35 +01:00
parent 9f4143e964
commit 51518a5fd3
2 changed files with 19 additions and 0 deletions

View File

@ -175,6 +175,11 @@ let
# without running any commands. Because this will also skip `shopt -s extglob`
# commands and extglob affects the Bash parser, we enable extglob always.
shellDryRun = "${stdenv.shell} -n -O extglob";
tests = {
succeedOnFailure = import ../tests/succeedOnFailure.nix { inherit stdenv; };
};
passthru.tests = lib.warn "Use `stdenv.tests` instead. `passthru` is a `mkDerivation` detail." stdenv.tests;
}
# Propagate any extra attributes. For instance, we use this to

View File

@ -0,0 +1,14 @@
{ stdenv }:
stdenv.mkDerivation {
name = "stdenv-test-succeedOnFailure";
succeedOnFailure = true;
passAsFile = [ "buildCommand" ];
buildCommand = ''
mkdir $out
echo foo > $out/foo
exit 1
'';
}