From 50b049554fed51cade556c62c60b1605ef9825ec Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 14 Oct 2022 02:29:46 +0200 Subject: [PATCH] postgresqlPackages.plv8: Add regression tests This is based on postgresqlPackages.age. --- .../sql/postgresql/ext/plv8/default.nix | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pkgs/servers/sql/postgresql/ext/plv8/default.nix b/pkgs/servers/sql/postgresql/ext/plv8/default.nix index 91eb31c91641..931a5deb40f1 100644 --- a/pkgs/servers/sql/postgresql/ext/plv8/default.nix +++ b/pkgs/servers/sql/postgresql/ext/plv8/default.nix @@ -100,6 +100,35 @@ stdenv.mkDerivation (finalAttrs: { grep -q "${finalAttrs.version}" "$out" kill -0 "$pid" ''; + + regression = stdenv.mkDerivation { + name = "plv8-regression"; + inherit (finalAttrs) src patches nativeBuildInputs buildInputs dontConfigure; + + buildPhase = '' + runHook preBuild + + # The regression tests need to be run in the order specified in the Makefile. + echo -e "include Makefile\nprint_regress_files:\n\t@echo \$(REGRESS)" > Makefile.regress + REGRESS_TESTS=$(make -f Makefile.regress print_regress_files) + + ${postgresql}/lib/pgxs/src/test/regress/pg_regress \ + --bindir='${postgresqlWithSelf}/bin' \ + --temp-instance=regress-instance \ + --dbname=contrib_regression \ + $REGRESS_TESTS + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + touch "$out" + + runHook postInstall + ''; + }; }; };