1997-01-18 09:01:32 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2000-01-09 08:54:00 +01:00
|
|
|
# GNUmakefile--
|
2005-07-25 02:58:27 +02:00
|
|
|
# Makefile for src/test/regress (the regression tests)
|
1997-01-18 09:01:32 +01:00
|
|
|
#
|
2022-01-08 01:04:57 +01:00
|
|
|
# Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
|
2005-07-25 02:58:27 +02:00
|
|
|
# Portions Copyright (c) 1994, Regents of the University of California
|
1997-01-18 09:01:32 +01:00
|
|
|
#
|
2010-09-20 22:08:53 +02:00
|
|
|
# src/test/regress/GNUmakefile
|
1997-01-18 09:01:32 +01:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2014-08-19 04:59:53 +02:00
|
|
|
PGFILEDESC = "pg_regress - test driver"
|
|
|
|
PGAPPICON = win32
|
|
|
|
|
2000-07-23 15:01:11 +02:00
|
|
|
subdir = src/test/regress
|
|
|
|
top_builddir = ../../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
1997-01-18 09:01:32 +01:00
|
|
|
|
2003-11-02 22:56:15 +01:00
|
|
|
# maximum simultaneous connections for parallel tests
|
2007-02-09 16:56:00 +01:00
|
|
|
MAXCONNOPT =
|
2003-11-02 22:56:15 +01:00
|
|
|
ifdef MAX_CONNECTIONS
|
|
|
|
MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
|
|
|
|
endif
|
|
|
|
|
2006-07-19 04:37:00 +02:00
|
|
|
# stuff to pass into build of pg_regress
|
2006-07-20 03:16:57 +02:00
|
|
|
EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
|
2022-03-25 08:44:31 +01:00
|
|
|
'-DSHELLPROG="$(SHELL)"'
|
2006-07-19 04:37:00 +02:00
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
##
|
|
|
|
## Prepare for tests
|
|
|
|
##
|
|
|
|
|
|
|
|
# Build regression test driver
|
|
|
|
|
2010-11-12 21:15:16 +01:00
|
|
|
all: pg_regress$(X)
|
2006-07-19 04:37:00 +02:00
|
|
|
|
2019-05-14 20:19:49 +02:00
|
|
|
pg_regress$(X): pg_regress.o pg_regress_main.o $(WIN32RES) | submake-libpgport
|
2010-07-05 20:54:38 +02:00
|
|
|
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2006-07-20 03:16:57 +02:00
|
|
|
# dependencies ensure that path changes propagate
|
|
|
|
pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
|
2012-02-07 21:42:19 +01:00
|
|
|
pg_regress.o: override CPPFLAGS += -I$(top_builddir)/src/port $(EXTRADEFS)
|
2006-07-20 03:16:57 +02:00
|
|
|
|
2018-04-10 22:14:55 +02:00
|
|
|
# note: because of the submake dependency, this rule's action is really a no-op
|
|
|
|
$(top_builddir)/src/port/pg_config_paths.h: | submake-libpgport
|
2006-07-20 03:16:57 +02:00
|
|
|
$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2008-10-02 00:38:57 +02:00
|
|
|
install: all installdirs
|
2006-07-19 04:37:00 +02:00
|
|
|
$(INSTALL_PROGRAM) pg_regress$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
|
2005-11-28 13:03:56 +01:00
|
|
|
|
2008-10-02 00:38:57 +02:00
|
|
|
installdirs:
|
2009-08-27 00:24:44 +02:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(subdir)'
|
2008-10-02 00:38:57 +02:00
|
|
|
|
2005-11-28 13:03:56 +01:00
|
|
|
uninstall:
|
2006-07-19 04:37:00 +02:00
|
|
|
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
|
2005-11-28 13:03:56 +01:00
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2006-02-27 17:09:50 +01:00
|
|
|
# Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE C.
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2005-07-25 02:58:27 +02:00
|
|
|
NAME = regress
|
2014-08-19 04:59:53 +02:00
|
|
|
OBJS = $(WIN32RES) regress.o
|
2005-07-25 02:58:27 +02:00
|
|
|
|
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
|
|
|
|
2008-04-07 16:15:58 +02:00
|
|
|
all: all-lib
|
2005-07-25 02:58:27 +02:00
|
|
|
|
2018-04-10 22:14:55 +02:00
|
|
|
# Ensure parallel safety if a build is started in this directory
|
|
|
|
$(OBJS): | submake-libpgport submake-generated-headers
|
|
|
|
|
2000-10-27 22:00:22 +02:00
|
|
|
|
2008-10-02 00:38:57 +02:00
|
|
|
# not installed by default
|
2000-10-27 22:00:22 +02:00
|
|
|
|
2008-10-02 00:38:57 +02:00
|
|
|
regress_data_files = \
|
2021-12-20 20:15:52 +01:00
|
|
|
$(wildcard $(srcdir)/sql/*.sql) \
|
|
|
|
$(wildcard $(srcdir)/expected/*.out) \
|
2008-10-02 00:38:57 +02:00
|
|
|
$(wildcard $(srcdir)/data/*.data) \
|
2021-05-11 23:52:04 +02:00
|
|
|
$(srcdir)/parallel_schedule $(srcdir)/resultmap
|
2008-10-02 00:38:57 +02:00
|
|
|
|
|
|
|
install-tests: all install install-lib installdirs-tests
|
|
|
|
$(MAKE) -C $(top_builddir)/contrib/spi install
|
2020-06-01 00:33:00 +02:00
|
|
|
for file in $(subst $(srcdir)/,,$(regress_data_files)); do \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/$$file '$(DESTDIR)$(pkglibdir)/regress/'$$file || exit; \
|
2008-10-02 00:38:57 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
installdirs-tests: installdirs
|
2009-08-27 00:24:44 +02:00
|
|
|
$(MKDIR_P) $(patsubst $(srcdir)/%/,'$(DESTDIR)$(pkglibdir)/regress/%',$(sort $(dir $(regress_data_files))))
|
2000-09-29 19:17:41 +02:00
|
|
|
|
|
|
|
|
2014-12-01 20:12:43 +01:00
|
|
|
# Get some extra C modules from contrib/spi
|
2008-05-30 02:04:32 +02:00
|
|
|
|
2014-12-01 20:12:43 +01:00
|
|
|
all: refint$(DLSUFFIX) autoinc$(DLSUFFIX)
|
2008-05-30 02:04:32 +02:00
|
|
|
|
|
|
|
refint$(DLSUFFIX): $(top_builddir)/contrib/spi/refint$(DLSUFFIX)
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
autoinc$(DLSUFFIX): $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX)
|
|
|
|
cp $< $@
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2013-07-02 03:10:36 +02:00
|
|
|
$(top_builddir)/contrib/spi/refint$(DLSUFFIX): | submake-contrib-spi ;
|
2008-05-30 02:04:32 +02:00
|
|
|
|
2013-07-02 03:10:36 +02:00
|
|
|
$(top_builddir)/contrib/spi/autoinc$(DLSUFFIX): | submake-contrib-spi ;
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2018-04-10 22:14:55 +02:00
|
|
|
submake-contrib-spi: | submake-libpgport submake-generated-headers
|
2013-07-02 03:10:36 +02:00
|
|
|
$(MAKE) -C $(top_builddir)/contrib/spi
|
|
|
|
|
2014-12-01 20:12:43 +01:00
|
|
|
.PHONY: submake-contrib-spi
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2008-05-30 02:04:32 +02:00
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
##
|
|
|
|
## Run tests
|
|
|
|
##
|
|
|
|
|
2022-01-14 09:29:17 +01:00
|
|
|
REGRESS_OPTS = --dlpath=. --max-concurrent-tests=20 \
|
2021-05-19 20:04:01 +02:00
|
|
|
$(EXTRA_REGRESS_OPTS)
|
2008-10-02 00:38:57 +02:00
|
|
|
|
2021-03-10 06:50:00 +01:00
|
|
|
check: all
|
2016-02-27 18:28:21 +01:00
|
|
|
$(pg_regress_check) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2021-03-10 06:50:00 +01:00
|
|
|
check-tests: all | temp-install
|
2016-02-27 18:28:21 +01:00
|
|
|
$(pg_regress_check) $(REGRESS_OPTS) $(MAXCONNOPT) $(TESTS) $(EXTRA_TESTS)
|
2014-01-29 00:10:00 +01:00
|
|
|
|
2021-03-10 06:50:00 +01:00
|
|
|
installcheck: all
|
2021-05-11 23:52:04 +02:00
|
|
|
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule --max-connections=1 $(EXTRA_TESTS)
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2021-03-10 06:50:00 +01:00
|
|
|
installcheck-parallel: all
|
2011-02-14 20:52:32 +01:00
|
|
|
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
|
2004-11-17 19:05:06 +01:00
|
|
|
|
2021-03-10 06:50:00 +01:00
|
|
|
installcheck-tests: all
|
2014-01-29 00:10:00 +01:00
|
|
|
$(pg_regress_installcheck) $(REGRESS_OPTS) $(TESTS) $(EXTRA_TESTS)
|
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
# old interfaces follow...
|
|
|
|
|
2000-11-22 14:16:24 +01:00
|
|
|
runcheck: check
|
|
|
|
runtest: installcheck
|
2004-11-17 19:05:06 +01:00
|
|
|
runtest-parallel: installcheck-parallel
|
1997-01-18 09:01:32 +01:00
|
|
|
|
2021-03-10 06:50:00 +01:00
|
|
|
bigtest: all
|
2021-05-11 23:52:04 +02:00
|
|
|
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule --max-connections=1 numeric_big
|
1999-11-19 19:51:52 +01:00
|
|
|
|
2021-03-10 06:50:00 +01:00
|
|
|
bigcheck: all | temp-install
|
2011-02-14 20:52:32 +01:00
|
|
|
$(pg_regress_check) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) numeric_big
|
1999-11-19 19:51:52 +01:00
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2000-11-22 14:16:24 +01:00
|
|
|
##
|
|
|
|
## Clean up
|
|
|
|
##
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2005-07-25 02:58:27 +02:00
|
|
|
clean distclean maintainer-clean: clean-lib
|
2000-09-29 19:17:41 +02:00
|
|
|
# things built by `all' target
|
2014-12-01 20:12:43 +01:00
|
|
|
rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX)
|
2010-09-28 02:55:27 +02:00
|
|
|
rm -f pg_regress_main.o pg_regress.o pg_regress$(X)
|
2000-09-29 19:17:41 +02:00
|
|
|
# things created by various check targets
|
2011-02-14 20:52:32 +01:00
|
|
|
rm -rf $(pg_regress_clean_files)
|