1{ lib, stdenv, fetchFromGitHub, postgresql, perl, perlPackages, which }:
2
3stdenv.mkDerivation rec {
4 pname = "pgtap";
5 version = "1.1.0";
6
7 src = fetchFromGitHub {
8 owner = "theory";
9 repo = "pgtap";
10 rev = "v${version}";
11 sha256 = "09fvzsl8m18yzpvrz6cqvs1ffzs451iwmb2mw39yq69jgqby5kqy";
12 };
13
14 nativeBuildInputs = [ postgresql perl perlPackages.TAPParserSourceHandlerpgTAP which ];
15
16 installPhase = ''
17 install -D {sql/pgtap--${version}.sql,pgtap.control} -t $out/share/postgresql/extension
18 '';
19
20 meta = with lib; {
21 description = "A unit testing framework for PostgreSQL";
22 longDescription = ''
23 pgTAP is a unit testing framework for PostgreSQL written in PL/pgSQL and PL/SQL.
24 It includes a comprehensive collection of TAP-emitting assertion functions,
25 as well as the ability to integrate with other TAP-emitting test frameworks.
26 It can also be used in the xUnit testing style.
27 '';
28 maintainers = with maintainers; [ willibutz ];
29 homepage = "https://pgtap.org";
30 inherit (postgresql.meta) platforms;
31 license = licenses.mit;
32 };
33}