Fix obsolete comment regarding FSM truncation.
[PostgreSQL.git] / src / test / regress / GNUmakefile
blobced6901f31607053554decb7537671f2f9fb5705
1 #-------------------------------------------------------------------------
3 # GNUmakefile--
4 # Makefile for src/test/regress (the regression tests)
6 # Portions Copyright (c) 1996-2008, 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 # port number for temp-installation test postmaster
18 TEMP_PORT = 5$(DEF_PGPORT)
20 # file with extra config for temp build
21 TEMP_CONF =
22 ifdef TEMP_CONFIG
23 TEMP_CONF += --temp-config=$(TEMP_CONFIG)
24 endif
26 # where to find psql for testing an existing installation
27 PSQLDIR = $(bindir)
29 # default encoding
30 MULTIBYTE = SQL_ASCII
32 # maximum simultaneous connections for parallel tests
33 MAXCONNOPT =
34 ifdef MAX_CONNECTIONS
35 MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
36 endif
38 # locale
39 NOLOCALE =
40 ifdef NO_LOCALE
41 NOLOCALE += --no-locale
42 endif
44 # stuff to pass into build of pg_regress
45 EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
46 '-DMAKEPROG="$(MAKE)"' \
47 '-DSHELLPROG="$(SHELL)"' \
48 '-DDLSUFFIX="$(DLSUFFIX)"'
51 ## Prepare for tests
54 # Build regression test driver
56 all: submake-libpgport pg_regress$(X)
58 pg_regress$(X): pg_regress.o pg_regress_main.o
59 $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
61 # dependencies ensure that path changes propagate
62 pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
63 $(CC) $(CFLAGS) $(CPPFLAGS) -I$(top_builddir)/src/port $(EXTRADEFS) -c -o $@ $<
65 $(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
66 $(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
68 install: all installdirs
69 $(INSTALL_PROGRAM) pg_regress$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
71 installdirs:
72 $(mkinstalldirs) '$(DESTDIR)$(pgxsdir)/$(subdir)'
74 uninstall:
75 rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
78 # Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE C.
80 NAME = regress
81 OBJS = regress.o
83 include $(top_srcdir)/src/Makefile.shlib
85 all: all-lib
87 # Test input and expected files. These are created by pg_regress itself, so we
88 # don't have a rule to create them. We do need rules to clean them however.
89 input_files = $(patsubst $(srcdir)/input/%.source,sql/%.sql, $(wildcard $(srcdir)/input/*.source))
90 output_files := $(patsubst $(srcdir)/output/%.source,expected/%.out, $(wildcard $(srcdir)/output/*.source))
93 # not installed by default
95 regress_data_files = \
96 $(filter-out $(addprefix $(srcdir)/,$(output_files)),$(wildcard $(srcdir)/expected/*.out)) \
97 $(wildcard $(srcdir)/input/*.source) \
98 $(wildcard $(srcdir)/output/*.source) \
99 $(filter-out $(addprefix $(srcdir)/,$(input_files)),$(wildcard $(srcdir)/sql/*.sql)) \
100 $(wildcard $(srcdir)/data/*.data) \
101 $(srcdir)/parallel_schedule $(srcdir)/serial_schedule $(srcdir)/resultmap
103 install-tests: all install install-lib installdirs-tests
104 $(MAKE) -C $(top_builddir)/contrib/spi install
105 for file in $(regress_data_files); do \
106 $(INSTALL_DATA) $$file '$(DESTDIR)$(pkglibdir)/regress/'$$file; \
107 done
109 installdirs-tests: installdirs
110 $(mkinstalldirs) $(patsubst $(srcdir)/%/,'$(DESTDIR)$(pkglibdir)/regress/%',$(sort $(dir $(regress_data_files))))
113 # Get some extra C modules from contrib/spi...
115 all: refint$(DLSUFFIX) autoinc$(DLSUFFIX)
117 refint$(DLSUFFIX): $(top_builddir)/contrib/spi/refint$(DLSUFFIX)
118 cp $< $@
120 autoinc$(DLSUFFIX): $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX)
121 cp $< $@
123 $(top_builddir)/contrib/spi/refint$(DLSUFFIX): $(top_srcdir)/contrib/spi/refint.c
124 $(MAKE) -C $(top_builddir)/contrib/spi refint$(DLSUFFIX)
126 $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX): $(top_srcdir)/contrib/spi/autoinc.c
127 $(MAKE) -C $(top_builddir)/contrib/spi autoinc$(DLSUFFIX)
130 # Tablespace setup
132 all: tablespace-setup
134 .PHONY: tablespace-setup
135 tablespace-setup:
136 rm -rf ./testtablespace
137 mkdir ./testtablespace
141 ## Run tests
144 pg_regress_call = ./pg_regress --inputdir=$(srcdir) --dlpath=. --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
146 check: all
147 $(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(TEMP_CONF)
149 installcheck: all
150 $(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule
152 installcheck-parallel: all
153 $(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT)
156 # old interfaces follow...
158 runcheck: check
159 runtest: installcheck
160 runtest-parallel: installcheck-parallel
162 bigtest: all
163 $(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule numeric_big
165 bigcheck: all
166 $(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) numeric_big
170 ## Clean up
173 clean distclean maintainer-clean: clean-lib
174 # things built by `all' target
175 rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX) pg_regress_main.o pg_regress.o pg_regress$(X)
176 # things created by various check targets
177 rm -f $(output_files) $(input_files)
178 rm -rf testtablespace
179 rm -rf results tmp_check log
180 rm -f regression.diffs regression.out regress.out run_check.out