Merge pull request #294117 from Pamplemousse/bash_unit

bash_unit: run tests in `checkPhase`
This commit is contained in:
Weijia Wang 2024-03-07 21:35:38 +01:00 committed by GitHub
commit a651d4cb55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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/