postgresql/src/interfaces/ecpg/test/Makefile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
3.3 KiB
Makefile
Raw Normal View History

2010-09-20 22:08:53 +02:00
# src/interfaces/ecpg/test/Makefile
PGFILEDESC = "ECPG Test - regression tests for ECPG"
PGAPPICON = win32
subdir = src/interfaces/ecpg/test
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
1999-12-16 07:53:12 +01:00
override CPPFLAGS := \
'-I$(top_builddir)/src/port' \
'-I$(top_srcdir)/src/test/regress' \
'-DHOST_TUPLE="$(host_tuple)"' \
'-DSHELLPROG="$(SHELL)"' \
$(CPPFLAGS)
ifneq ($(build_os),mingw32)
abs_builddir := $(shell pwd)
else
abs_builddir := $(shell sh -c "pwd -W")
endif
2007-01-20 18:16:17 +01:00
all install installdirs uninstall distprep:
$(MAKE) -C connect $@
$(MAKE) -C sql $@
$(MAKE) -C pgtypeslib $@
$(MAKE) -C preproc $@
$(MAKE) -C compat_informix $@
$(MAKE) -C compat_oracle $@
$(MAKE) -C thread $@
2006-08-04 10:52:18 +02:00
clean distclean maintainer-clean:
$(MAKE) -C connect $@
$(MAKE) -C sql $@
$(MAKE) -C pgtypeslib $@
$(MAKE) -C preproc $@
2006-08-04 10:52:18 +02:00
$(MAKE) -C compat_informix $@
$(MAKE) -C compat_oracle $@
2006-08-04 10:52:18 +02:00
$(MAKE) -C thread $@
rm -rf tmp_check results log
rm -f pg_regress regression.diffs regression.out pg_regress_ecpg.o $(WIN32RES)
# Build regression test driver
all: pg_regress$(X)
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 $@
$(top_builddir)/src/test/regress/pg_regress.o:
$(MAKE) -C $(dir $@) $(notdir $@)
# dependencies ensure that path changes propagate
pg_regress_ecpg.o: pg_regress_ecpg.c $(top_builddir)/src/port/pg_config_paths.h
$(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
# 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)
check: all
$(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
# Connect to the server using TCP, and add a TCP-specific test.
checktcp: all | temp-install
$(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
installcheck: all
./pg_regress $(REGRESS_OPTS) --bindir='$(bindir)' $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule
# 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
check-prepared-txns: all | temp-install
$(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