2010-09-20 22:08:53 +02:00
|
|
|
# src/interfaces/ecpg/test/Makefile
|
1998-05-06 15:03:47 +02:00
|
|
|
|
2014-08-19 04:59:53 +02:00
|
|
|
PGFILEDESC = "ECPG Test - regression tests for ECPG"
|
|
|
|
PGAPPICON = win32
|
|
|
|
|
2001-08-11 12:52:09 +02:00
|
|
|
subdir = src/interfaces/ecpg/test
|
|
|
|
top_builddir = ../../../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
1999-12-16 07:53:12 +01:00
|
|
|
|
2009-01-15 10:30:20 +01:00
|
|
|
override CPPFLAGS := \
|
2011-06-16 03:45:23 +02:00
|
|
|
'-I$(top_builddir)/src/port' \
|
|
|
|
'-I$(top_srcdir)/src/test/regress' \
|
2009-01-15 10:30:20 +01:00
|
|
|
'-DHOST_TUPLE="$(host_tuple)"' \
|
|
|
|
'-DSHELLPROG="$(SHELL)"' \
|
|
|
|
$(CPPFLAGS)
|
|
|
|
|
2009-01-05 10:54:13 +01:00
|
|
|
ifneq ($(build_os),mingw32)
|
2006-08-28 18:13:11 +02:00
|
|
|
abs_builddir := $(shell pwd)
|
|
|
|
else
|
2010-12-24 19:31:28 +01:00
|
|
|
abs_builddir := $(shell sh -c "pwd -W")
|
2006-08-28 18:13:11 +02:00
|
|
|
endif
|
|
|
|
|
2007-01-20 18:16:17 +01:00
|
|
|
all install installdirs uninstall distprep:
|
2006-08-02 15:43:23 +02:00
|
|
|
$(MAKE) -C connect $@
|
|
|
|
$(MAKE) -C sql $@
|
|
|
|
$(MAKE) -C pgtypeslib $@
|
2006-09-05 14:11:03 +02:00
|
|
|
$(MAKE) -C preproc $@
|
2006-08-02 15:43:23 +02:00
|
|
|
$(MAKE) -C compat_informix $@
|
2018-03-14 00:54:13 +01:00
|
|
|
$(MAKE) -C compat_oracle $@
|
2006-08-02 15:43:23 +02:00
|
|
|
$(MAKE) -C thread $@
|
2006-08-04 10:52:18 +02:00
|
|
|
|
|
|
|
clean distclean maintainer-clean:
|
|
|
|
$(MAKE) -C connect $@
|
|
|
|
$(MAKE) -C sql $@
|
|
|
|
$(MAKE) -C pgtypeslib $@
|
2006-09-05 14:11:03 +02:00
|
|
|
$(MAKE) -C preproc $@
|
2006-08-04 10:52:18 +02:00
|
|
|
$(MAKE) -C compat_informix $@
|
2018-03-14 00:54:13 +01:00
|
|
|
$(MAKE) -C compat_oracle $@
|
2006-08-04 10:52:18 +02:00
|
|
|
$(MAKE) -C thread $@
|
2006-08-04 16:18:09 +02:00
|
|
|
rm -rf tmp_check results log
|
2014-07-14 20:07:52 +02:00
|
|
|
rm -f pg_regress regression.diffs regression.out pg_regress_ecpg.o $(WIN32RES)
|
2007-06-12 13:07:34 +02:00
|
|
|
|
|
|
|
# Build regression test driver
|
|
|
|
|
|
|
|
all: pg_regress$(X)
|
|
|
|
|
2014-07-14 20:07:52 +02:00
|
|
|
pg_regress$(X): pg_regress_ecpg.o $(WIN32RES) $(top_builddir)/src/test/regress/pg_regress.o
|
Ensure link commands list *.o files before LDFLAGS.
It's important for link commands to list *.o input files before -l
switches for libraries, as library code may not get pulled into the link
unless referenced by an earlier command-line entry. This is certainly
necessary for static libraries (.a style). Apparently on some platforms
it is also necessary for shared libraries, as reported by Donald Dong.
We often put -l switches for within-tree libraries into LDFLAGS, meaning
that link commands that list *.o files after LDFLAGS are hazardous.
Most of our link commands got this right, but a few did not. In
particular, places that relied on gmake's default implicit link rule
failed, because that puts LDFLAGS first. Fix that by overriding the
built-in rule with our own. The implicit link rules in
src/makefiles/Makefile.* for single-.o-file shared libraries mostly
got this wrong too, so fix them. I also changed the link rules for the
backend and a couple of other places for consistency, even though they
are not (currently) at risk because they aren't adding any -l switches
to LDFLAGS.
Arguably, the real problem here is that we're abusing LDFLAGS by
putting -l switches in it and we should stop doing that. But changing
that would be quite invasive, so I'm not eager to do so.
Perhaps this is a candidate for back-patching, but so far it seems
that problems can only be exhibited in test code we don't normally
build, and at least some of the problems are new in HEAD anyway.
So I'll refrain for now.
Donald Dong and Tom Lane
Discussion: https://postgr.es/m/CAKABAquXn-BF-vBeRZxhzvPyfMqgGuc74p8BmQZyCFDpyROBJQ@mail.gmail.com
2019-01-02 19:57:42 +01:00
|
|
|
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
|
2009-01-15 10:30:20 +01:00
|
|
|
|
|
|
|
$(top_builddir)/src/test/regress/pg_regress.o:
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
2006-08-02 15:43:23 +02:00
|
|
|
|
2007-06-12 13:07:34 +02:00
|
|
|
# dependencies ensure that path changes propagate
|
|
|
|
pg_regress_ecpg.o: pg_regress_ecpg.c $(top_builddir)/src/port/pg_config_paths.h
|
2006-08-02 15:43:23 +02:00
|
|
|
|
2007-06-12 13:07:34 +02:00
|
|
|
$(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
|
|
|
|
$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
|
2006-08-02 15:43:23 +02:00
|
|
|
|
2022-08-20 19:59:01 +02:00
|
|
|
# Common options for tests
|
|
|
|
#
|
|
|
|
# Need to specify expecteddir explicitly, as the inputdir is located in the
|
|
|
|
# build directory, because the files need to be compiled. Other pg_regress
|
|
|
|
# style tests have the expecteddir in the source directory.
|
|
|
|
#
|
|
|
|
# Also pick up anything passed in EXTRA_REGRESS_OPTS.
|
|
|
|
REGRESS_OPTS = --expecteddir=$(srcdir) \
|
|
|
|
--dbname=ecpg1_regression,ecpg2_regression --create-role=regress_ecpg_user1,regress_ecpg_user2 \
|
|
|
|
$(EXTRA_REGRESS_OPTS)
|
2006-08-28 18:13:11 +02:00
|
|
|
|
|
|
|
check: all
|
2017-03-18 10:35:14 +01:00
|
|
|
$(with_temp_install) ./pg_regress $(REGRESS_OPTS) --temp-instance=./tmp_check $(TEMP_CONF) --bindir= $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule sql/twophase
|
2006-08-02 15:43:23 +02:00
|
|
|
|
2017-11-11 23:35:22 +01:00
|
|
|
# Connect to the server using TCP, and add a TCP-specific test.
|
2017-11-06 03:51:08 +01:00
|
|
|
checktcp: all | temp-install
|
2017-11-11 23:35:22 +01:00
|
|
|
$(with_temp_install) ./pg_regress $(REGRESS_OPTS) --temp-instance=./tmp_check $(TEMP_CONF) --bindir= $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --host=localhost sql/twophase connect/test1
|
2001-08-11 12:52:09 +02:00
|
|
|
|
2006-08-28 18:13:11 +02:00
|
|
|
installcheck: all
|
2015-04-23 14:59:52 +02:00
|
|
|
./pg_regress $(REGRESS_OPTS) --bindir='$(bindir)' $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule
|
2017-03-18 10:35:14 +01:00
|
|
|
|
|
|
|
# Versions of the check tests that include the twophase commit test.
|
|
|
|
# It only makes sense to run these if set up to use prepared transactions,
|
|
|
|
# via TEMP_CONFIG for the check case, or via the postgresql.conf for the
|
|
|
|
# installcheck case.
|
|
|
|
|
|
|
|
installcheck-prepared-txns: all
|
|
|
|
./pg_regress $(REGRESS_OPTS) --bindir='$(bindir)' $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule sql/twophase
|
|
|
|
|
2017-11-06 03:51:08 +01:00
|
|
|
check-prepared-txns: all | temp-install
|
2017-03-18 10:35:14 +01:00
|
|
|
$(with_temp_install) ./pg_regress $(REGRESS_OPTS) --temp-instance=./tmp_check $(TEMP_CONF) --bindir= $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule sql/twophase
|