Debian Codegraph @

src/interfaces/ecpg/test/Makefile

raw
1 # src/interfaces/ecpg/test/Makefile
2
3 PGFILEDESC = "ECPG Test - regression tests for ECPG"
4 PGAPPICON = win32
5
6 subdir = src/interfaces/ecpg/test
7 top_builddir = ../../../..
8 include $(top_builddir)/src/Makefile.global
9
10 override CPPFLAGS := \
11 '-I$(top_builddir)/src/port' \
12 '-I$(top_srcdir)/src/test/regress' \
13 '-I$(libpq_srcdir)' \
14 '-DHOST_TUPLE="$(host_tuple)"' \
15 '-DSHELLPROG="$(SHELL)"' \
16 $(CPPFLAGS)
17
18 ifneq ($(build_os),mingw32)
19 abs_builddir := $(shell pwd)
20 else
21 abs_builddir := $(shell sh -c "pwd -W")
22 endif
23
24 all install installdirs uninstall:
25 $(MAKE) -C connect $@
26 $(MAKE) -C sql $@
27 $(MAKE) -C pgtypeslib $@
28 $(MAKE) -C preproc $@
29 $(MAKE) -C compat_informix $@
30 $(MAKE) -C compat_oracle $@
31 $(MAKE) -C thread $@
32
33 clean distclean:
34 $(MAKE) -C connect $@
35 $(MAKE) -C sql $@
36 $(MAKE) -C pgtypeslib $@
37 $(MAKE) -C preproc $@
38 $(MAKE) -C compat_informix $@
39 $(MAKE) -C compat_oracle $@
40 $(MAKE) -C thread $@
41 rm -rf tmp_check results log
42 rm -f pg_regress regression.diffs regression.out pg_regress_ecpg.o $(WIN32RES)
43
44 # Build regression test driver
45
46 all: pg_regress$(X)
47
48 pg_regress$(X): pg_regress_ecpg.o $(WIN32RES) $(top_builddir)/src/test/regress/pg_regress.o
49 $(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
50
51 $(top_builddir)/src/test/regress/pg_regress.o:
52 $(MAKE) -C $(dir $@) $(notdir $@)
53
54 # dependencies ensure that path changes propagate
55 pg_regress_ecpg.o: pg_regress_ecpg.c $(top_builddir)/src/port/pg_config_paths.h
56
57 $(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
58 $(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
59
60 # Common options for tests
61 #
62 # Need to specify expecteddir explicitly, as the inputdir is located in the
63 # build directory, because the files need to be compiled. Other pg_regress
64 # style tests have the expecteddir in the source directory.
65 #
66 # Also pick up anything passed in EXTRA_REGRESS_OPTS.
67 REGRESS_OPTS = --expecteddir=$(srcdir) \
68 --dbname=ecpg1_regression,ecpg2_regression --create-role=regress_ecpg_user1,regress_ecpg_user2 \
69 $(EXTRA_REGRESS_OPTS)
70
71 check: all
72 $(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
73
74 # Connect to the server using TCP, and add a TCP-specific test.
75 checktcp: all | temp-install
76 $(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
77
78 installcheck: all
79 ./pg_regress $(REGRESS_OPTS) --bindir='$(bindir)' $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule
80
81 # Versions of the check tests that include the twophase commit test.
82 # It only makes sense to run these if set up to use prepared transactions,
83 # via TEMP_CONFIG for the check case, or via the postgresql.conf for the
84 # installcheck case.
85
86 installcheck-prepared-txns: all
87 ./pg_regress $(REGRESS_OPTS) --bindir='$(bindir)' $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule sql/twophase
88
89 check-prepared-txns: all | temp-install
90 $(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