mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
stdenv.tests: Add succeedOnFailure
This commit is contained in:
parent
9f4143e964
commit
51518a5fd3
@ -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
|
||||
|
14
pkgs/stdenv/tests/succeedOnFailure.nix
Normal file
14
pkgs/stdenv/tests/succeedOnFailure.nix
Normal 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
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user