about summary refs log tree commit diff
path: root/pkgs/test/overriding.nix
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-01-20 18:57:13 +0200
committerArtturin <Artturin@artturin.com>2023-01-20 19:20:03 +0200
commit9c0ac5691c5c8e8902fe5a93599b07e3f21464aa (patch)
treec32678099a2c5bd903c5c629e374af1eaf99e026 /pkgs/test/overriding.nix
parentb94fa2c25315d2086cb4c50716598ffa65363593 (diff)
tests.overriding: init
only outputs the first failing test atm
Diffstat (limited to 'pkgs/test/overriding.nix')
-rw-r--r--pkgs/test/overriding.nix23
1 files changed, 23 insertions, 0 deletions
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;
+}