diff options
Diffstat (limited to 'debian/tests')
-rw-r--r-- | debian/tests/Makefile.regress | 5 | ||||
-rw-r--r-- | debian/tests/control | 7 | ||||
-rwxr-xr-x | debian/tests/installcheck | 30 | ||||
-rw-r--r-- | debian/tests/postgresql.conf | 8 | ||||
-rwxr-xr-x | debian/tests/run-testsuite | 5 |
5 files changed, 55 insertions, 0 deletions
diff --git a/debian/tests/Makefile.regress b/debian/tests/Makefile.regress new file mode 100644 index 0000000..f01a80a --- /dev/null +++ b/debian/tests/Makefile.regress @@ -0,0 +1,5 @@ +MODULE_big = regress +OBJS = regress.o +PG_CONFIG = pg_config +PGXS = $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..bd61eb8 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,7 @@ +Tests: run-testsuite +Depends: @, build-essential, perl, hunspell-en-us, locales, netcat-openbsd, net-tools, logrotate +Restrictions: needs-root + +Tests: installcheck +Depends: @, build-essential +Restrictions: allow-stderr diff --git a/debian/tests/installcheck b/debian/tests/installcheck new file mode 100755 index 0000000..33cab91 --- /dev/null +++ b/debian/tests/installcheck @@ -0,0 +1,30 @@ +#!/bin/sh + +set -eux + +SOURCE=$(dpkg-parsechangelog -SSource) +MAJOR=${SOURCE#*-} +top_srcdir=$PWD + +cd src/test/regress + +# compile regress.so +make -f $top_srcdir/debian/tests/Makefile.regress PG_CONFIG=/usr/lib/postgresql/$MAJOR/bin/pg_config with_llvm=no + +# tell regression files that regress.so is not installed +sed -i -e "s:@libdir@/regress:$PWD/regress:" input/*.source output/*.source + +# create tablespace and results directories +rm -rf testtablespace results regression.* +mkdir testtablespace results +[ "$(id -u)" = "0" ] && chown postgres: testtablespace results + +# run the regression tests +if ! pg_virtualenv -v $MAJOR \ + /usr/lib/postgresql/$MAJOR/lib/pgxs/src/test/regress/pg_regress \ + --schedule=parallel_schedule \ + --temp-config=$top_srcdir/debian/tests/postgresql.conf + then + cat regression.diffs + exit 1 +fi diff --git a/debian/tests/postgresql.conf b/debian/tests/postgresql.conf new file mode 100644 index 0000000..c68a521 --- /dev/null +++ b/debian/tests/postgresql.conf @@ -0,0 +1,8 @@ +# config used by pg_regress --temp-config + +fsync = off + +# force JITing of all queries in tests +jit = on +jit_above_cost = 0 +jit_optimize_above_cost = 1000 diff --git a/debian/tests/run-testsuite b/debian/tests/run-testsuite new file mode 100755 index 0000000..bb08eb5 --- /dev/null +++ b/debian/tests/run-testsuite @@ -0,0 +1,5 @@ +#!/bin/sh +set -e + +cd /usr/share/postgresql-common +./testsuite -v 13 |