From 739c450d1e5cf6e3c7154ca0c85f06201eef1350 Mon Sep 17 00:00:00 2001 From: Pamplemousse Date: Sat, 13 Jan 2024 08:49:49 +0100 Subject: [PATCH] bash_unit: run tests in `checkPhase` --- pkgs/tools/misc/bash_unit/default.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pkgs/tools/misc/bash_unit/default.nix b/pkgs/tools/misc/bash_unit/default.nix index f929348bc1bb..19cebbb07e60 100644 --- a/pkgs/tools/misc/bash_unit/default.nix +++ b/pkgs/tools/misc/bash_unit/default.nix @@ -13,6 +13,30 @@ stdenv.mkDerivation rec { sha256 = "sha256-sYs7b6I1VhO2TLLhMFuaV9AtLoavcoKvCRYfVNGAg20="; }; + patchPhase = '' + runHook prePatch + + patchShebangs bash_unit + + for t in tests/test_*; do + chmod +x "$t" # make test file visible to `patchShebangs` + patchShebangs "$t" + chmod -x "$t" + done + + runHook postPatch + ''; + + doCheck = true; + + checkPhase = '' + runHook preCheck + + ./bash_unit ./tests/test_core.sh + + runHook postCheck + ''; + installPhase = '' mkdir -p $out/bin cp bash_unit $out/bin/