Skip to content

Commit

Permalink
tests.overriding: init
Browse files Browse the repository at this point in the history
only outputs the first failing test atm
  • Loading branch information
Artturin committed Jan 20, 2023
1 parent b3e88fc commit d3db1cc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/test/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ with pkgs;

nixos-functions = callPackage ./nixos-functions {};

overriding = callPackage ./overriding.nix { };

patch-shebangs = callPackage ./patch-shebangs {};

texlive = callPackage ./texlive {};
Expand Down
23 changes: 23 additions & 0 deletions pkgs/test/overriding.nix
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit d3db1cc

Please sign in to comment.