Commit 22aa6201 authored by Christoph Berg's avatar Christoph Berg

pg_buildext: Add "installcheck" action for use with autopkgtest.

parent cb1c3c24
......@@ -10,6 +10,7 @@ postgresql-common (153) UNRELEASED; urgency=medium
* t/003_package_checks.t: Add test case for logrotate.
* t/020_create_sql_remove.t: Make pipe writes unbuffered.
* pg_buildext: Document the loop action (present since version 141).
* pg_buildext: Add "installcheck" action for use with autopkgtest.
[ Martin Pitt ]
* testsuite, pg_virtualenv: Don't fail if ifconfig is not installed. We
......
......@@ -92,6 +92,33 @@ loop() {
echo "### done $1 ###"
}
installcheck() {
prepare_env $1
if [ "$target" ]; then # if target is given, use it, else stay in the top source dir
# if a Makefile was created by configure, use it, else the top level Makefile
[ -f $vtarget/Makefile ] || makefile="-f $srcdir/Makefile"
if ! pg_virtualenv -v $1 \
make -C $vtarget $makefile installcheck \
PG_CONFIG="$pgc" VPATH="$srcdir" srcdir="$srcdir" USE_PGXS=1; then
if [ -r $vtarget/regression.diffs ]; then
echo "**** $vtarget/regression.diffs ****"
cat $vtarget/regression.diffs
fi
exit 1
fi
else
if ! pg_virtualenv -v $1 \
make installcheck PG_CONFIG="$pgc" srcdir="$srcdir" USE_PGXS=1; then
if [ -r regression.diffs ]; then
echo "**** regression.diffs ****"
cat regression.diffs
fi
exit 1
fi
fi
}
versions() {
[ -e /usr/share/postgresql-common/supported-versions ] ||
die "/usr/share/postgresql-common/supported-versions not found"
......@@ -126,12 +153,17 @@ do
configure|build|install|clean|loop)
[ "$target" ] || die "syntax: pg_buildext $action [...]"
# be verbose?
echo "### $action $v ###"
$action $v
;;
installcheck)
echo "### $action $v ###"
$action $v
;;
*)
die "unsupported $action."
die "unsupported $action"
;;
esac
done
......@@ -57,6 +57,12 @@ should be used if the package does not support VPATH builds. As it also invokes
B<make install>, it should be placed were installation happens in debian/rules,
rather than where build would normally be called.
=item B<installcheck> [I<build-dir>]
Use B<pg_virtualenv make installcheck> to run the extension regression tests.
This is meant to be run from C<debian/tests/control> using B<autopkgtest>. If
I<build-dir> is omitted, the top source directory is used.
=back
=head1 SUPPORTED VERSIONS
......@@ -97,18 +103,43 @@ with B<+> so the sub-makes can talk with the make jobserver.
=head1 EXAMPLE
build-stamp:
+pg_buildext configure $(CURDIR) build-%v "--libdir=/usr/lib/postgresql/%v/lib --datadir=/usr/share/postgresql-%v-plsh"
+pg_buildext build $(CURDIR) build-%v
override_dh_auto_configure:
+pg_buildext configure build-%v "--libdir=/usr/lib/postgresql/%v/lib --datadir=/usr/share/postgresql-%v-plsh"
override_dh_auto_build:
+pg_buildext build build-%v
override_dh_auto_test:
# nothing to do here, see debian/tests/* instead
override_dh_auto_install:
+pg_buildext install build-%v postgresql-%v-plsh
override_dh_installdocs:
dh_installdocs --all README.*
override_dh_auto_clean:
+pg_buildext clean build-%v
=head1 COMPATIBILITY
Earlier B<pg_buildext> versions required a "source dir" argument after the
action. This is now deprecated, but still accepted (and ignored).
B<pg_buildext loop> was introduced in postgresql-server-dev-all (>= 141~).
The usage of "all" or "X.Y+" in debian/pgversions was introduced in
postgresql-server-dev-all (>= 148~).
install: build
+pg_buildext install $(CURDIR) build-%v postgresql-%v-plsh
B<pg_buildext installcheck> was introduced in postgresql-server-dev-all (>=
153~).
clean:
+pg_buildext clean $(CURDIR) build-%v
=head1 SEE ALSO
C</usr/share/postgresql-common/supported-versions>, autopkgtest(1),
pg_virtualenv(1).
=head1 AUTHOR
=head1 AUTHORS
Dimitri Fontaine L<E<lt>dim@tapoueh.orgE<gt>>, with extensions by
Christoph Berg L<E<lt>myon@debian.orgE<gt>>.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment