This patch allow to use custom postgres launcher for tests (tap®ress)
by setting environment variable PGLAUNCHER.
Other known methods (like:
https://wiki.postgresql.org/wiki/Valgrind) requires
to perform installation, build system modifications, executable replacement etc...
And proposed way is simpler and more flexible.
** Use-case: run checks under Valgrind
- prepare launcher
echo 'exec valgrind postgres "$@"' > /tmp/pgvalgrind
chmod +x /tmp/pgvalgrind
- execute regress tests under Valgrind
PGLAUNCHER=/tmp/pgvalgrind TESTS=gin make check-tests
- execute concrete tap-test under Valgrind
PGLAUNCHER=/tmp/pgvalgrind PROVE_TESTS=t/
001_stream_rep.pl make \
check -C src/test/recovery
** Use-case: execute tests with different postgres versions
- prepare multi-launcher
cat <<EOF > /tmp/launcher
cp -f `pwd`/src/backend/postgres.v* \`pg_config --bindir\`
exec postgres.v\$V "\$@"
EOF
chmod +x /tmp/launcher
- make some versions of postgres binary
./configure "CFLAGS=..." && make
mv src/backend/postgres src/backend/postgres.v1
./configure "CFLAGS=..." && make
mv src/backend/postgres src/backend/postgres.v2
- run checks with different postgres binaries
PGLAUNCHER=/tmp/launcher V=1 make check -C contrib/bloom
PGLAUNCHER=/tmp/launcher V=2 make check -C contrib/bloom