about summary refs log tree commit diff
path: root/pkgs/tools/misc/cod
diff options
context:
space:
mode:
authorsuperherointj <5861043+superherointj@users.noreply.github.com>2022-04-07 11:56:46 -0300
committersuperherointj <5861043+superherointj@users.noreply.github.com>2022-04-07 12:44:45 -0300
commit64f3350532071a9866d586ae369f76d988e8a111 (patch)
treef01852647faf81189dc4cced047753a4acfac996 /pkgs/tools/misc/cod
parent4da89993ed353d40fa7515f0cfffadc34ebb683c (diff)
cod: fix tests
Co-authored-by: @jnetod @thiagokokada
Diffstat (limited to 'pkgs/tools/misc/cod')
-rw-r--r--pkgs/tools/misc/cod/default.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/tools/misc/cod/default.nix b/pkgs/tools/misc/cod/default.nix
index 741487c668772..3c76e68b8947e 100644
--- a/pkgs/tools/misc/cod/default.nix
+++ b/pkgs/tools/misc/cod/default.nix
@@ -1,4 +1,4 @@
-{ lib, fetchFromGitHub, buildGoModule }:
+{ lib, fetchFromGitHub, buildGoModule, python3 }:
 
 buildGoModule rec {
   pname = "cod";
@@ -15,7 +15,16 @@ buildGoModule rec {
 
   ldflags = [ "-s" "-w" "-X main.GitSha=${src.rev}" ];
 
-  doCheck = false;
+  checkInputs = [ python3 ];
+
+  preCheck = ''
+    pushd test/binaries/
+    for f in *.py; do
+      patchShebangs ''$f
+    done
+    popd
+    export COD_TEST_BINARY="''${NIX_BUILD_TOP}/go/bin/cod"
+  '';
 
   meta = with lib; {
     description = "Tool for generating Bash/Fish/Zsh autocompletions based on `--help` output";