tests.overriding: init

only outputs the first failing test atm
This commit is contained in:
Artturin 2023-01-20 18:57:13 +02:00
parent b94fa2c253
commit 9c0ac5691c
2 changed files with 25 additions and 0 deletions

View file

@ -59,6 +59,8 @@ with pkgs;
nixos-functions = callPackage ./nixos-functions {};
overriding = callPackage ./overriding.nix { };
patch-shebangs = callPackage ./patch-shebangs {};
texlive = callPackage ./texlive {};

23
pkgs/test/overriding.nix Normal file
View file

@ -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;
}