On Mon, 2013-04-08 at 10:15 +0200, Christoph Berg wrote:
> Re: Peter Eisentraut 2013-04-06 
> <20130406030939.14051.80312.report...@vanquo.pezone.net>
> > Package: postgresql-plperl-9.1
> > Version: 9.1.9-1
> > Severity: important
> > 
> > Creating a plperl function on kfreebsd (amd64) immediately crashes the
> > PostgreSQL server in the plperl.so module.  You can see this either by
> > running the built-in regression tests (should probably be done during
> > the build anyway) or by running the tests from
> > t/020_create_sql_remove.t in the postgresql-common package.
> 
> Unfortunately the postgresql-common tests need root, so we can't run
> these at build time.

I meant the regression tests that ship with upstream.

(Getting the postgresql-common tests running on kfreebsd is a whole
another matter -- we'll get to that next. ;-) )

> I'd favor activating as many regression tests as possible at build
> time. I was looking into that some time ago but somehow got lost
> between the isolation tests and similar more "academic" tests.

Should be pretty simple: Just run make check-world.  I think the current
stuff in debian/rules was written before check-world was invented.
Something like the attached patch (not fully tested) should do the job.

diff -Nru postgresql-9.1-9.1.9/debian/rules postgresql-9.1-9.1.9/debian/rules
--- postgresql-9.1-9.1.9/debian/rules	2013-04-02 04:27:35.000000000 -0400
+++ postgresql-9.1-9.1.9/debian/rules	2013-04-05 21:24:50.000000000 -0400
@@ -138,15 +138,13 @@
 	set -e; \
 	patch --no-backup-if-mismatch -p1 < debian/disable-root-check.patch; \
 	patch --no-backup-if-mismatch -p1 < debian/pg_regress-in-tmp.patch; \
-	make -C build/src/test/regress bigcheck || fail=1; \
+	make -C build -k check-world || fail=1; \
 	patch --no-backup-if-mismatch -Rp1 < debian/pg_regress-in-tmp.patch; \
 	patch --no-backup-if-mismatch -Rp1 < debian/disable-root-check.patch; \
 	if [ -n "$$fail" ]; then \
-	    for l in regression.diffs log/initdb.log log/postmaster.log; do \
-	    	if [ -e build/src/test/regress/$$l ]; then \
-		    echo "********* $$l *******"; \
-		    cat build/src/test/regress/$$l; \
-		fi; \
+	    for l in `find build -name regression.diffs -o -name initdb.log -o name postmaster.log`; do \
+		echo "********* $$l *******"; \
+		cat $$l; \
 	    done; \
 	    $(TESTSUITE_FAIL_CMD); \
 	fi
@@ -155,36 +153,5 @@
 override_dh_strip:
 	dh_strip --dbg-package=postgresql-$(MAJOR_VER)-dbg
 
-# run tests in contrib in temporary test installations, using programs
-# from local tree
-contrib-check:
-	set -e; cd build/contrib; \
-	for d in *; do \
-	    [ -d $$d/sql ] || continue; \
-	    echo "==============  Running tests in $$d"; \
-	    (cd $$d; \
-	    if ! ../../src/test/regress/pg_regress --top-builddir=../.. --temp-install=tmp_check --dbname=contrib_regression `cd sql; ls *.sql | sed 's/.sql$$//'`; then \
-		 cat regression.diffs; \
-	    fi); \
-	done
-
-# run tests in contrib in temporary test installation, using programs
-# from system installation
-contrib-installcheck:
-	# set up temporary db
-	rm -rf tmp_data
-	mkdir tmp_data
-	/usr/lib/postgresql/$(MAJOR_VER)/bin/initdb -D tmp_data
-	/usr/lib/postgresql/$(MAJOR_VER)/bin/pg_ctl -D tmp_data -l tmp_data/postgres.log -o '-k /tmp' start
-	# wait until it started up
-	while !/usr/lib/postgresql/$(MAJOR_VER)/bin/psql -h /tmp -l >/dev/null 2>&1; do sleep 1; done
-	sleep 1
-	while !/usr/lib/postgresql/$(MAJOR_VER)/bin/psql -h /tmp -l >/dev/null 2>&1; do sleep 1; done
-	# run the tests
-	-cd build/contrib; make installcheck
-	/usr/lib/postgresql/$(MAJOR_VER)/bin/pg_ctl -D tmp_data stop
-	# find and print the regression diffs
-	find build/contrib/ -name regression.diffs -exec cat '{}' \;
-
 override_dh_builddeb:
 	dh_builddeb -- -Zxz

Reply via email to