1# src/interfaces/ecpg/test/Makefile 2 3PGFILEDESC = "ECPG Test - regression tests for ECPG" 4PGAPPICON = win32 5 6subdir = src/interfaces/ecpg/test 7top_builddir = ../../../.. 8include $(top_builddir)/src/Makefile.global 9 10override CPPFLAGS := \ 11 '-I$(top_builddir)/src/port' \ 12 '-I$(top_srcdir)/src/test/regress' \ 13 '-DHOST_TUPLE="$(host_tuple)"' \ 14 '-DSHELLPROG="$(SHELL)"' \ 15 '-DDLSUFFIX="$(DLSUFFIX)"' \ 16 $(CPPFLAGS) 17 18# default encoding for regression tests 19ENCODING = SQL_ASCII 20 21ifneq ($(build_os),mingw32) 22abs_builddir := $(shell pwd) 23else 24abs_builddir := $(shell sh -c "pwd -W") 25endif 26 27all install installdirs uninstall distprep: 28 $(MAKE) -C connect $@ 29 $(MAKE) -C sql $@ 30 $(MAKE) -C pgtypeslib $@ 31 $(MAKE) -C preproc $@ 32 $(MAKE) -C compat_informix $@ 33 $(MAKE) -C thread $@ 34 35clean distclean maintainer-clean: 36 $(MAKE) -C connect $@ 37 $(MAKE) -C sql $@ 38 $(MAKE) -C pgtypeslib $@ 39 $(MAKE) -C preproc $@ 40 $(MAKE) -C compat_informix $@ 41 $(MAKE) -C thread $@ 42 rm -rf tmp_check results log 43 rm -f pg_regress regression.diffs regression.out pg_regress_ecpg.o $(WIN32RES) 44 45# Build regression test driver 46 47all: pg_regress$(X) 48 49pg_regress$(X): pg_regress_ecpg.o $(WIN32RES) $(top_builddir)/src/test/regress/pg_regress.o 50 $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $^ $(LIBS) -o $@ 51 52$(top_builddir)/src/test/regress/pg_regress.o: 53 $(MAKE) -C $(dir $@) $(notdir $@) 54 55# dependencies ensure that path changes propagate 56pg_regress_ecpg.o: pg_regress_ecpg.c $(top_builddir)/src/port/pg_config_paths.h 57 58$(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global 59 $(MAKE) -C $(top_builddir)/src/port pg_config_paths.h 60 61# When doing a VPATH build, copy over the .pgc, .stdout and .stderr 62# files so that the driver script can find them. We have to use an 63# absolute path for the targets, because otherwise make will try to 64# locate the missing files using VPATH, and will find them in 65# $(srcdir), but the point here is that we want to copy them from 66# $(srcdir) to the build directory. 67 68ifdef VPATH 69remaining_files_src := $(wildcard $(srcdir)/*/*.pgc) $(wildcard $(srcdir)/expected/*.c) $(wildcard $(srcdir)/expected/*.stdout) $(wildcard $(srcdir)/expected/*.stderr) $(srcdir)/resultmap 70remaining_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(remaining_files_src)) 71 72all: $(remaining_files_build) 73$(remaining_files_build): $(abs_builddir)/%: $(srcdir)/% 74 ln -s $< $@ 75endif 76 77# Common options for tests. Also pick up anything passed in EXTRA_REGRESS_OPTS 78REGRESS_OPTS = --dbname=ecpg1_regression,ecpg2_regression --create-role=regress_ecpg_user1,regress_ecpg_user2 $(EXTRA_REGRESS_OPTS) 79 80check: all 81 $(with_temp_install) ./pg_regress $(REGRESS_OPTS) --temp-instance=./tmp_check $(TEMP_CONF) --bindir= $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule 82 83# Connect to the server using TCP, and add a TCP-specific test. 84checktcp: all | temp-install 85 $(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 connect/test1 86 87installcheck: all 88 ./pg_regress $(REGRESS_OPTS) --bindir='$(bindir)' $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule 89