2021-02-07 16:43:16 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, perl
|
|
|
|
, perlPackages
|
|
|
|
, sharnessExtensions ? {} }:
|
|
|
|
|
2023-03-11 17:13:46 +01:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-02-07 16:43:16 +01:00
|
|
|
pname = "sharness";
|
2023-03-11 17:13:46 +01:00
|
|
|
version = "1.2.0";
|
2021-02-07 16:43:16 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-03-11 17:13:46 +01:00
|
|
|
owner = "felipec";
|
|
|
|
repo = "sharness";
|
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-C0HVWgTm9iXDSFyXcUVRfT0ip31YGaaZ6ZvxggK/x7o=";
|
2021-02-07 16:43:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Used for testing
|
|
|
|
nativeBuildInputs = [ perl perlPackages.IOTty ];
|
|
|
|
|
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
|
|
|
makeFlags = [ "prefix=$(out)" ];
|
|
|
|
|
|
|
|
extensions = lib.mapAttrsToList (k: v: "${k}.sh ${v}") sharnessExtensions;
|
|
|
|
|
|
|
|
postInstall = lib.optionalString (sharnessExtensions != {}) ''
|
|
|
|
extDir=$out/share/sharness/sharness.d
|
|
|
|
mkdir -p "$extDir"
|
|
|
|
linkExtensions() {
|
|
|
|
set -- $extensions
|
|
|
|
while [ $# -ge 2 ]; do
|
|
|
|
ln -s "$2" "$extDir/$1"
|
|
|
|
shift 2
|
|
|
|
done
|
|
|
|
}
|
|
|
|
linkExtensions
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2023-03-11 17:13:46 +01:00
|
|
|
passthru.SHARNESS_TEST_SRCDIR = finalAttrs.finalPackage + "/share/sharness";
|
|
|
|
|
2021-02-07 16:43:16 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Portable shell library to write, run and analyze automated tests adhering to Test Anything Protocol (TAP)";
|
|
|
|
homepage = "https://github.com/chriscool/sharness";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = [ maintainers.spacefrogg ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2023-03-11 17:13:46 +01:00
|
|
|
})
|