Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / test / regress / GNUmakefile
blob8ce5d25010e8d74e3e092af154f9a17bac8818b4
1 #-------------------------------------------------------------------------
3 # GNUmakefile--
4 # Makefile for src/test/regress (the regression tests)
6 # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
7 # Portions Copyright (c) 1994, Regents of the University of California
9 # $PostgreSQL$
11 #-------------------------------------------------------------------------
13 subdir = src/test/regress
14 top_builddir = ../../..
15 include $(top_builddir)/src/Makefile.global
17 # file with extra config for temp build
18 TEMP_CONF =
19 ifdef TEMP_CONFIG
20 TEMP_CONF += --temp-config=$(TEMP_CONFIG)
21 endif
23 # where to find psql for testing an existing installation
24 PSQLDIR = $(bindir)
26 # default encoding
27 MULTIBYTE = SQL_ASCII
29 # maximum simultaneous connections for parallel tests
30 MAXCONNOPT =
31 ifdef MAX_CONNECTIONS
32 MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
33 endif
35 # locale
36 NOLOCALE =
37 ifdef NO_LOCALE
38 NOLOCALE += --no-locale
39 endif
41 # stuff to pass into build of pg_regress
42 EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
43 '-DMAKEPROG="$(MAKE)"' \
44 '-DSHELLPROG="$(SHELL)"' \
45 '-DDLSUFFIX="$(DLSUFFIX)"'
48 ## Prepare for tests
51 # Build regression test driver
53 all: submake-libpgport pg_regress$(X)
55 pg_regress$(X): pg_regress.o pg_regress_main.o
56 $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
58 # dependencies ensure that path changes propagate
59 pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
60 $(CC) $(CFLAGS) $(CPPFLAGS) -I$(top_builddir)/src/port $(EXTRADEFS) -c -o $@ $<
62 $(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
63 $(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
65 install: all installdirs
66 $(INSTALL_PROGRAM) pg_regress$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
68 installdirs:
69 $(mkinstalldirs) '$(DESTDIR)$(pgxsdir)/$(subdir)'
71 uninstall:
72 rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
75 # Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE C.
77 NAME = regress
78 OBJS = regress.o
80 include $(top_srcdir)/src/Makefile.shlib
82 all: all-lib
84 # Test input and expected files. These are created by pg_regress itself, so we
85 # don't have a rule to create them. We do need rules to clean them however.
86 input_files = $(patsubst $(srcdir)/input/%.source,sql/%.sql, $(wildcard $(srcdir)/input/*.source))
87 output_files := $(patsubst $(srcdir)/output/%.source,expected/%.out, $(wildcard $(srcdir)/output/*.source))
90 # not installed by default
92 regress_data_files = \
93 $(filter-out $(addprefix $(srcdir)/,$(output_files)),$(wildcard $(srcdir)/expected/*.out)) \
94 $(wildcard $(srcdir)/input/*.source) \
95 $(wildcard $(srcdir)/output/*.source) \
96 $(filter-out $(addprefix $(srcdir)/,$(input_files)),$(wildcard $(srcdir)/sql/*.sql)) \
97 $(wildcard $(srcdir)/data/*.data) \
98 $(srcdir)/parallel_schedule $(srcdir)/serial_schedule $(srcdir)/resultmap
100 install-tests: all install install-lib installdirs-tests
101 $(MAKE) -C $(top_builddir)/contrib/spi install
102 for file in $(regress_data_files); do \
103 $(INSTALL_DATA) $$file '$(DESTDIR)$(pkglibdir)/regress/'$$file; \
104 done
106 installdirs-tests: installdirs
107 $(mkinstalldirs) $(patsubst $(srcdir)/%/,'$(DESTDIR)$(pkglibdir)/regress/%',$(sort $(dir $(regress_data_files))))
110 # Get some extra C modules from contrib/spi...
112 all: refint$(DLSUFFIX) autoinc$(DLSUFFIX)
114 refint$(DLSUFFIX): $(top_builddir)/contrib/spi/refint$(DLSUFFIX)
115 cp $< $@
117 autoinc$(DLSUFFIX): $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX)
118 cp $< $@
120 $(top_builddir)/contrib/spi/refint$(DLSUFFIX): $(top_srcdir)/contrib/spi/refint.c
121 $(MAKE) -C $(top_builddir)/contrib/spi refint$(DLSUFFIX)
123 $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX): $(top_srcdir)/contrib/spi/autoinc.c
124 $(MAKE) -C $(top_builddir)/contrib/spi autoinc$(DLSUFFIX)
127 # Tablespace setup
129 all: tablespace-setup
131 .PHONY: tablespace-setup
132 tablespace-setup:
133 rm -rf ./testtablespace
134 mkdir ./testtablespace
138 ## Run tests
141 pg_regress_call = ./pg_regress --inputdir=$(srcdir) --dlpath=. --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
143 check: all
144 $(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(TEMP_CONF)
146 installcheck: all
147 $(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule
149 installcheck-parallel: all
150 $(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT)
153 # old interfaces follow...
155 runcheck: check
156 runtest: installcheck
157 runtest-parallel: installcheck-parallel
159 bigtest: all
160 $(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule numeric_big
162 bigcheck: all
163 $(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) numeric_big
167 ## Clean up
170 clean distclean maintainer-clean: clean-lib
171 # things built by `all' target
172 rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX) pg_regress_main.o pg_regress.o pg_regress$(X)
173 # things created by various check targets
174 rm -f $(output_files) $(input_files)
175 rm -rf testtablespace
176 rm -rf results tmp_check log
177 rm -f regression.diffs regression.out regress.out run_check.out