Commit a38c85bd authored by Tom Lane's avatar Tom Lane

Rewrite pg_regress as a C program instead of a shell script.

This allows it to be used on Windows without installing mingw
(though you do still need 'diff'), and opens the door to future
improvements such as message localization.
Magnus Hagander and Tom Lane.
parent 88295244
......@@ -3,7 +3,7 @@ Frequently Asked Questions (FAQ) for PostgreSQL 7.3
HP-UX Specific
TO BE READ IN CONJUNCTION WITH THE NORMAL FAQ
=======================================================
last updated: $Date: 2004/09/02 17:46:24 $
last updated: $Date: 2006/07/19 02:37:00 $
current maintainer: Tom Lane (tgl@sss.pgh.pa.us)
original author: Tom Lane (tgl@sss.pgh.pa.us)
......@@ -84,19 +84,3 @@ low-order-digit differences in the geometry tests, which vary depending
on which compiler and math library versions you use.
Any other error is cause for suspicion.
The parallel regression test script (gmake check) is known to lock up
on PA-RISC when run under HP's Bourne shells: /usr/bin/sh and
/sbin/sh. To fix this problem, you will need PHCO_30269 with its
dependent patch or successor patches:
PHCO_30269 s700_800 cumulative sh-posix(1) patch
PHCO_29816 s700_800 rc(1M) scripts cumulative patch
To work around this problem, use ksh to run the regression script:
gmake SHELL=/bin/ksh check
If you see that the tests have stopped making progress and only a shell
process is consuming CPU, kill the shell process and start over with the
above command.
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.52 2006/06/18 15:38:36 petere Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.53 2006/07/19 02:37:00 tgl Exp $ -->
<chapter id="regress">
<title id="regress-title">Regression Tests</title>
......@@ -110,19 +110,6 @@ gmake MAX_CONNECTIONS=10 check
runs no more than ten tests concurrently.
</para>
<para>
On some systems, the default Bourne-compatible shell
(<filename>/bin/sh</filename>) gets confused when it has to manage
too many child processes in parallel. This may cause the parallel
test run to lock up or fail. In such cases, specify a different
Bourne-compatible shell on the command line, for example:
<screen>
gmake SHELL=/bin/ksh check
</screen>
If no non-broken shell is available, you may be able to work around the
problem by limiting the number of connections, as shown above.
</para>
<para>
To run the tests after installation<![%standalone-ignore;[ (see <xref linkend="installation">)]]>,
initialize a data area and start the
......@@ -370,13 +357,10 @@ testname/platformpattern=comparisonfilename
The test name is just the name of the particular regression test
module. The platform pattern is a pattern in the style of the Unix
tool <command>expr</> (that is, a regular expression with an implicit
<literal>^</literal> anchor
at the start). It is matched against the platform name as printed
by <command>config.guess</command> followed by
<literal>:gcc</literal> or <literal>:cc</literal>, depending on
whether you use the GNU compiler or the system's native compiler
(on systems where there is a difference). The comparison file
name is the base name of the substitute result comparison file.
<literal>^</literal> anchor at the start). It is matched against the
platform name as printed by <command>config.guess</command>.
The comparison file name is the base name of the substitute result
comparison file.
</para>
<para>
......
# PGXS: PostgreSQL extensions makefile
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.7 2005/12/09 21:19:36 petere Exp $
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.8 2006/07/19 02:37:00 tgl Exp $
# This file contains generic rules to build many kinds of simple
# extension modules. You only need to set a few variables and include
......@@ -230,16 +230,16 @@ endif # VPATH
.PHONY: submake
submake:
ifndef PGXS
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
endif
# against installed postmaster
installcheck: submake
$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
$(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
# in-tree test doesn't work yet (no way to install my shared library)
#check: all submake
# $(SHELL) $(top_builddir)/src/test/regress/pg_regress --temp-install \
# $(top_builddir)/src/test/regress/pg_regress --temp-install \
# --top-builddir=$(top_builddir) $(REGRESS_OPTS) $(REGRESS)
check:
@echo "'make check' is not supported."
......
# Makefile for PL/Perl
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.26 2005/12/09 21:19:36 petere Exp $
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.27 2006/07/19 02:37:00 tgl Exp $
subdir = src/pl/plperl
top_builddir = ../../..
......@@ -84,11 +84,11 @@ uninstall:
rm -f '$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)'
installcheck: submake
$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
$(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
.PHONY: submake
submake:
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
clean distclean maintainer-clean: clean-lib
rm -f SPI.c $(OBJS)
......
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.24 2005/12/09 21:19:36 petere Exp $
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.25 2006/07/19 02:37:00 tgl Exp $
subdir = src/pl/plpython
top_builddir = ../../..
......@@ -103,11 +103,11 @@ uninstall:
rm -f '$(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)'
installcheck: submake
$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
$(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
.PHONY: submake
submake:
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
clean distclean maintainer-clean: clean-lib
rm -f $(OBJS)
......
......@@ -2,7 +2,7 @@
#
# Makefile for the pltcl shared object
#
# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.48 2005/12/09 21:19:36 petere Exp $
# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.49 2006/07/19 02:37:00 tgl Exp $
#
#-------------------------------------------------------------------------
......@@ -90,11 +90,11 @@ uninstall:
$(MAKE) -C modules $@
installcheck: submake
$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
$(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
.PHONY: submake
submake:
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
else # TCL_SHARED_BUILD = 0
......
......@@ -6,7 +6,7 @@
# Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.57 2006/03/05 15:59:11 momjian Exp $
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.58 2006/07/19 02:37:00 tgl Exp $
#
#-------------------------------------------------------------------------
......@@ -34,32 +34,33 @@ ifdef NO_LOCALE
NOLOCALE += --no-locale
endif
# stuff to pass into build of pg_regress
EXTRADEFS = '-DPGBINDIR="$(bindir)"' \
'-DLIBDIR="$(libdir)"' \
'-DPGSHAREDIR="$(datadir)"' \
'-DHOST_TUPLE="$(host_tuple)"' \
'-DMAKEPROG="$(MAKE)"'
##
## Prepare for tests
##
# Build regression test driver
all: pg_regress
all: submake-libpgport pg_regress$(X)
pg_regress$(X): pg_regress.o
$(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@
pg_regress: pg_regress.sh GNUmakefile $(top_builddir)/src/Makefile.global
sed -e 's,@bindir@,$(bindir),g' \
-e 's,@libdir@,$(libdir),g' \
-e 's,@pkglibdir@,$(pkglibdir),g' \
-e 's,@datadir@,$(datadir),g' \
-e 's/@VERSION@/$(VERSION)/g' \
-e 's/@host_tuple@/$(host_tuple)/g' \
-e 's,@GMAKE@,$(MAKE),g' \
-e 's/@enable_shared@/$(enable_shared)/g' \
-e 's/@GCC@/$(GCC)/g' \
$< >$@
chmod a+x $@
# depend on Makefile.global to ensure that symbol changes propagate
pg_regress.o: pg_regress.c $(top_builddir)/src/Makefile.global
$(CC) $(CFLAGS) $(CPPFLAGS) $(EXTRADEFS) -c -o $@ $<
install: pg_regress
$(INSTALL_SCRIPT) pg_regress '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress'
install: pg_regress$(X)
$(INSTALL_PROGRAM) pg_regress$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
uninstall:
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
# Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE C.
......@@ -143,17 +144,17 @@ all-spi:
check: all
-rm -rf ./testtablespace
mkdir ./testtablespace
$(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)
installcheck: all
-rm -rf ./testtablespace
mkdir ./testtablespace
$(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
installcheck-parallel: all
-rm -rf ./testtablespace
mkdir ./testtablespace
$(SHELL) ./pg_regress --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)
./pg_regress --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)
# old interfaces follow...
......@@ -163,10 +164,10 @@ runtest: installcheck
runtest-parallel: installcheck-parallel
bigtest:
$(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) numeric_big
./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) numeric_big
bigcheck:
$(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) numeric_big
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) numeric_big
##
......@@ -177,7 +178,7 @@ clean distclean maintainer-clean: clean-lib
# things built by `all' target
rm -f $(NAME)$(DLSUFFIX) $(OBJS)
$(MAKE) -C $(contribdir)/spi clean
rm -f $(output_files) $(input_files) pg_regress
rm -f $(output_files) $(input_files) pg_regress.o pg_regress$(X)
# things created by various check targets
rm -rf testtablespace
rm -rf results tmp_check log
......
......@@ -7,6 +7,6 @@
# GNU make uses a make file named "GNUmakefile" in preference to "Makefile"
# if it exists. Postgres is shipped with a "GNUmakefile".
all install clean dep depend:
all install clean dep depend check installcheck:
@echo "You must use GNU make to use Postgres. It may be installed"
@echo "on your system with the name 'gmake'."
This diff is collapsed.
This diff is collapsed.
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