Consistently use "superuser" instead of "super user"
[pgsql.git] / src / test / regress / GNUmakefile
blobfe6e0c98aa2e03b6b6adebdc257176467ff9c963
1 #-------------------------------------------------------------------------
3 # GNUmakefile--
4 # Makefile for src/test/regress (the regression tests)
6 # Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7 # Portions Copyright (c) 1994, Regents of the University of California
9 # src/test/regress/GNUmakefile
11 #-------------------------------------------------------------------------
13 PGFILEDESC = "pg_regress - test driver"
14 PGAPPICON = win32
16 subdir = src/test/regress
17 top_builddir = ../../..
18 include $(top_builddir)/src/Makefile.global
20 # maximum simultaneous connections for parallel tests
21 MAXCONNOPT =
22 ifdef MAX_CONNECTIONS
23 MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
24 endif
26 # stuff to pass into build of pg_regress
27 EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
28 '-DSHELLPROG="$(SHELL)"' \
29 '-DDLSUFFIX="$(DLSUFFIX)"'
32 ## Prepare for tests
35 # Build regression test driver
37 all: pg_regress$(X)
39 pg_regress$(X): pg_regress.o pg_regress_main.o $(WIN32RES) | submake-libpgport
40 $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
42 # dependencies ensure that path changes propagate
43 pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
44 pg_regress.o: override CPPFLAGS += -I$(top_builddir)/src/port $(EXTRADEFS)
46 # note: because of the submake dependency, this rule's action is really a no-op
47 $(top_builddir)/src/port/pg_config_paths.h: | submake-libpgport
48 $(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
50 install: all installdirs
51 $(INSTALL_PROGRAM) pg_regress$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
53 installdirs:
54 $(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(subdir)'
56 uninstall:
57 rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
60 # Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE C.
62 NAME = regress
63 OBJS = $(WIN32RES) regress.o
65 include $(top_srcdir)/src/Makefile.shlib
67 all: all-lib
69 # Ensure parallel safety if a build is started in this directory
70 $(OBJS): | submake-libpgport submake-generated-headers
72 # Test input and expected files. These are created by pg_regress itself, so we
73 # don't have a rule to create them. We do need rules to clean them however.
74 input_files = $(patsubst $(srcdir)/input/%.source,sql/%.sql, $(wildcard $(srcdir)/input/*.source))
75 output_files := $(patsubst $(srcdir)/output/%.source,expected/%.out, $(wildcard $(srcdir)/output/*.source))
78 # not installed by default
80 regress_data_files = \
81 $(filter-out $(addprefix $(srcdir)/,$(output_files)),$(wildcard $(srcdir)/expected/*.out)) \
82 $(wildcard $(srcdir)/input/*.source) \
83 $(wildcard $(srcdir)/output/*.source) \
84 $(filter-out $(addprefix $(srcdir)/,$(input_files)),$(wildcard $(srcdir)/sql/*.sql)) \
85 $(wildcard $(srcdir)/data/*.data) \
86 $(srcdir)/parallel_schedule $(srcdir)/resultmap
88 install-tests: all install install-lib installdirs-tests
89 $(MAKE) -C $(top_builddir)/contrib/spi install
90 for file in $(subst $(srcdir)/,,$(regress_data_files)); do \
91 $(INSTALL_DATA) $(srcdir)/$$file '$(DESTDIR)$(pkglibdir)/regress/'$$file || exit; \
92 done
94 installdirs-tests: installdirs
95 $(MKDIR_P) $(patsubst $(srcdir)/%/,'$(DESTDIR)$(pkglibdir)/regress/%',$(sort $(dir $(regress_data_files))))
98 # Get some extra C modules from contrib/spi
100 all: refint$(DLSUFFIX) autoinc$(DLSUFFIX)
102 refint$(DLSUFFIX): $(top_builddir)/contrib/spi/refint$(DLSUFFIX)
103 cp $< $@
105 autoinc$(DLSUFFIX): $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX)
106 cp $< $@
108 $(top_builddir)/contrib/spi/refint$(DLSUFFIX): | submake-contrib-spi ;
110 $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX): | submake-contrib-spi ;
112 submake-contrib-spi: | submake-libpgport submake-generated-headers
113 $(MAKE) -C $(top_builddir)/contrib/spi
115 .PHONY: submake-contrib-spi
119 ## Run tests
122 REGRESS_OPTS = --dlpath=. --max-concurrent-tests=20 --make-testtablespace-dir \
123 $(EXTRA_REGRESS_OPTS)
125 check: all
126 $(pg_regress_check) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
128 check-tests: all | temp-install
129 $(pg_regress_check) $(REGRESS_OPTS) $(MAXCONNOPT) $(TESTS) $(EXTRA_TESTS)
131 installcheck: all
132 $(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule --max-connections=1 $(EXTRA_TESTS)
134 installcheck-parallel: all
135 $(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
137 installcheck-tests: all
138 $(pg_regress_installcheck) $(REGRESS_OPTS) $(TESTS) $(EXTRA_TESTS)
140 standbycheck: all
141 $(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/standby_schedule --use-existing
143 # old interfaces follow...
145 runcheck: check
146 runtest: installcheck
147 runtest-parallel: installcheck-parallel
149 bigtest: all
150 $(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule --max-connections=1 numeric_big
152 bigcheck: all | temp-install
153 $(pg_regress_check) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) numeric_big
157 ## Clean up
160 clean distclean maintainer-clean: clean-lib
161 # things built by `all' target
162 rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX)
163 rm -f pg_regress_main.o pg_regress.o pg_regress$(X)
164 # things created by various check targets
165 rm -f $(output_files) $(input_files)
166 rm -rf testtablespace
167 rm -rf $(pg_regress_clean_files)