about summary refs log tree commit diff
path: root/pkgs/test/hooks
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2022-12-11 13:31:50 +0200
committerArtturin <Artturin@artturin.com>2022-12-12 21:39:56 +0200
commit9cb5662187377146daf2b2abd54f4bce9ab59343 (patch)
tree8e05d8406fe241e54649aed7d92be05beb065ccc /pkgs/test/hooks
parent84a7cadfd2d419b00148b5b826568c5ba59b93d5 (diff)
tests: move stdenv hook tests to stdenv.hooks
Diffstat (limited to 'pkgs/test/hooks')
-rw-r--r--pkgs/test/hooks/default.nix24
1 files changed, 2 insertions, 22 deletions
diff --git a/pkgs/test/hooks/default.nix b/pkgs/test/hooks/default.nix
index fe3a9b2a21672..aabf939b68657 100644
--- a/pkgs/test/hooks/default.nix
+++ b/pkgs/test/hooks/default.nix
@@ -1,28 +1,8 @@
 # To run these tests:
 # nix-build -A tests.hooks
 
-{ stdenv, pkgs, lib }:
+{ stdenv, tests, lib }:
 
 {
-  # this attrset is for hooks in `stdenv.defaultNativeBuildInputs`
-  default-stdenv-hooks = lib.recurseIntoAttrs {
-    make-symlinks-relative = stdenv.mkDerivation {
-      name = "test-make-symlinks-relative";
-      passAsFile = [ "buildCommand" ];
-      buildCommand = ''
-        mkdir -p $out/{bar,baz}
-        source1="$out/bar/foo"
-        destination1="$out/baz/foo"
-        echo foo > $source1
-        ln -s $source1 $destination1
-        echo "symlink before patching: $(readlink $destination1)"
-
-        _makeSymlinksRelative
-
-        echo "symlink after patching: $(readlink $destination1)"
-        ([[ -e $destination1 ]] && echo "symlink isn't broken") || (echo "symlink is broken" && exit 1)
-        ([[ $(readlink $destination1) == "../bar/foo" ]] && echo "absolute symlink was made relative") || (echo "symlink was not made relative" && exit 1)
-      '';
-    };
-  };
+  default-stdenv-hooks = lib.recurseIntoAttrs tests.stdenv.hooks;
 }