1 #-------------------------------------------------------------------------
4 # Makefile for regress (the regression tests)
6 # Copyright (c) 1994, Regents of the University of California
10 # $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.43 2003/11/02 21:56:15 tgl Exp $
12 #-------------------------------------------------------------------------
14 subdir = src/test/regress
15 top_builddir = ../../..
16 include $(top_builddir)/src/Makefile.global
18 contribdir := $(top_builddir)/contrib
20 override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
21 override CFLAGS += $(CFLAGS_SL)
23 SHLIB_LINK = $(BE_DLLLIBS)
28 # maximum simultaneous connections for parallel tests
31 MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
39 # Build regression test driver
43 pg_regress: pg_regress.sh GNUmakefile
44 sed -e 's,@bindir@,$(bindir),g' \
45 -e 's,@libdir@,$(libdir),g' \
46 -e 's,@pkglibdir@,$(pkglibdir),g' \
47 -e 's,@datadir@,$(datadir),g' \
48 -e 's/@VERSION@/$(VERSION)/g' \
49 -e 's/@host_tuple@/$(host_tuple)/g' \
50 -e 's,@GMAKE@,$(MAKE),g' \
51 -e 's/@enable_shared@/$(enable_shared)/g' \
52 -e 's/@GCC@/$(GCC)/g' \
57 # Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE 'C'.
59 DLOBJS := regress$(DLSUFFIX)
60 # This is for some platforms
62 DLOBJS += regress$(EXPSUFF)
68 # Build test input and expected files
70 file_list := copy create_function_1 create_function_2 misc constraints
71 input_files := $(foreach file, $(file_list), sql/$(file).sql)
72 output_files := $(foreach file, $(file_list), expected/$(file).out)
74 all: $(input_files) $(output_files)
76 abs_srcdir := $(shell cd $(srcdir) && pwd)
77 abs_builddir := $(shell pwd)
80 sed -e 's,@abs_srcdir@,$(abs_srcdir),g' \
81 -e 's,@abs_builddir@,$(abs_builddir),g' \
82 -e 's/@DLSUFFIX@/$(DLSUFFIX)/g' $< >$@
85 $(input_files): sql/%.sql: input/%.source
88 $(output_files): expected/%.out: output/%.source
91 # When doing a VPATH build, copy over the remaining .sql and .out
92 # files so that the driver script can find them. We have to use an
93 # absolute path for the targets, because otherwise make will try to
94 # locate the missing files using VPATH, and will find them in
95 # $(srcdir), but the point here is that we want to copy them from
96 # $(srcdir) to the build directory.
99 remaining_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) $(srcdir)/resultmap
100 remaining_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(remaining_files_src))
102 all: $(remaining_files_build)
103 $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
108 # And finally some extra C modules...
114 $(MAKE) -C $(contribdir)/spi refint$(DLSUFFIX) autoinc$(DLSUFFIX)
122 $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT)
125 $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)
128 # old interfaces follow...
131 runtest: installcheck
134 $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) numeric_big
137 $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) numeric_big
144 clean distclean maintainer-clean:
145 # things built by `all' target
146 $(MAKE) -C $(contribdir)/spi clean
147 rm -f $(output_files) $(input_files) $(DLOBJS) regress.o pg_regress
148 # things created by various check targets
149 rm -rf results tmp_check log
150 rm -f regression.diffs regression.out regress.out run_check.out
151 ifeq ($(PORTNAME), cygwin)
155 rm -f $(remaining_files_build)