diff options
Diffstat (limited to 'pkgs/test')
-rw-r--r-- | pkgs/test/default.nix | 2 | ||||
-rw-r--r-- | pkgs/test/overriding.nix | 23 |
2 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix index 818001018b3ae..445aa9a756780 100644 --- a/pkgs/test/default.nix +++ b/pkgs/test/default.nix @@ -59,6 +59,8 @@ with pkgs; nixos-functions = callPackage ./nixos-functions {}; + overriding = callPackage ./overriding.nix { }; + patch-shebangs = callPackage ./patch-shebangs {}; texlive = callPackage ./texlive {}; diff --git a/pkgs/test/overriding.nix b/pkgs/test/overriding.nix new file mode 100644 index 0000000000000..eab710af5afab --- /dev/null +++ b/pkgs/test/overriding.nix @@ -0,0 +1,23 @@ +{ lib, pkgs, stdenvNoCC }: + +let + tests = + let + p = pkgs.python3Packages.xpybutil.overridePythonAttrs (_: { dontWrapPythonPrograms = true; }); + in + [ + ({ + name = "overridePythonAttrs"; + expr = !lib.hasInfix "wrapPythonPrograms" p.postFixup; + expected = true; + }) + ]; +in + +stdenvNoCC.mkDerivation { + name = "test-overriding"; + passthru = { inherit tests; }; + buildCommand = '' + touch $out + '' + lib.concatMapStringsSep "\n" (t: "([[ ${lib.boolToString t.expr} == ${lib.boolToString t.expected} ]] && echo '${t.name} success') || (echo '${t.name} fail' && exit 1)") tests; +} |