summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorcherryblossom <31467609+cherryblossom000@users.noreply.github.com>2022-01-04 00:29:36 +1100
committercherryblossom <31467609+cherryblossom000@users.noreply.github.com>2022-01-04 00:30:56 +1100
commitfae46e66a5df220327b45e0d7c27c6961cf922ce (patch)
tree189be081d98a87de3fda4299ce57d2ea25c0e7ad /pkgs/shells
parent5773043ac1445a0e9904d6618d337b32891db210 (diff)
downloadnixpkgs-fae46e66a5df220327b45e0d7c27c6961cf922ce.tar
nixpkgs-fae46e66a5df220327b45e0d7c27c6961cf922ce.tar.gz
nixpkgs-fae46e66a5df220327b45e0d7c27c6961cf922ce.tar.bz2
nixpkgs-fae46e66a5df220327b45e0d7c27c6961cf922ce.tar.lz
nixpkgs-fae46e66a5df220327b45e0d7c27c6961cf922ce.tar.xz
nixpkgs-fae46e66a5df220327b45e0d7c27c6961cf922ce.tar.zst
nixpkgs-fae46e66a5df220327b45e0d7c27c6961cf922ce.zip
elvish: move test to `installCheckPhase`
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/elvish/default.nix40
1 files changed, 21 insertions, 19 deletions
diff --git a/pkgs/shells/elvish/default.nix b/pkgs/shells/elvish/default.nix
index 66d14b9b9ff..ba03ffb4f45 100644
--- a/pkgs/shells/elvish/default.nix
+++ b/pkgs/shells/elvish/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildGoModule, fetchFromGitHub, runCommand, elvish }:
+{ lib, buildGoModule, fetchFromGitHub, runCommand }:
 
 buildGoModule rec {
   pname = "elvish";
@@ -19,6 +19,25 @@ buildGoModule rec {
 
   doCheck = false;
 
+  doInstallCheck = true;
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    $out${passthru.shellPath} -c "
+      fn expect {|key expected|
+        var actual = \$buildinfo[\$key]
+        if (not-eq \$actual \$expected) {
+          fail '\$buildinfo['\$key']: expected '(to-string \$expected)', got '(to-string \$actual)
+        }
+      }
+
+      expect version ${version}
+      expect reproducible \$true
+    "
+
+    runHook postInstallCheck
+  '';
+
   meta = with lib; {
     description = "A friendly and expressive command shell";
     longDescription = ''
@@ -31,22 +50,5 @@ buildGoModule rec {
     maintainers = with maintainers; [ vrthra AndersonTorres ];
   };
 
-  passthru = {
-    shellPath = "/bin/elvish";
-    tests = runCommand "${pname}-buildinfo-test" {} ''
-      mkdir $out
-
-      ${elvish}/bin/elvish -c "
-        fn expect {|key expected|
-          var actual = \$buildinfo[\$key]
-          if (not-eq \$actual \$expected) {
-            fail '\$buildinfo['\$key']: expected '(to-string \$expected)', got '(to-string \$actual)
-          }
-        }
-
-        expect version ${version}
-        expect reproducible \$true
-      "
-    '';
-  };
+  passthru.shellPath = "/bin/elvish";
 }