a14770
#
a14770
# Simplified makefile for running the PostgreSQL regression tests
a14770
# in an RPM installation
a14770
#
a14770
a14770
# maximum simultaneous connections for parallel tests
a14770
MAXCONNOPT =
a14770
ifdef MAX_CONNECTIONS
a14770
MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
a14770
endif
a14770
a14770
# locale
a14770
NOLOCALE =
a14770
ifdef NO_LOCALE
a14770
NOLOCALE += --no-locale
a14770
endif
a14770
a14770
srcdir := .
a14770
a14770
REGRESS_OPTS += --dlpath=.
a14770
a14770
pg_regress_locale_flags = $(if $(ENCODING),--encoding=$(ENCODING)) $(NOLOCALE)
a14770
a14770
pg_regress_installcheck = ./pg_regress --inputdir=$(srcdir) --bindir=@bindir@ $(pg_regress_locale_flags)
a14770
a14770
# Test input and expected files.  These are created by pg_regress itself, so we
a14770
# don't have a rule to create them.  We do need rules to clean them however.
a14770
ifile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/input/*.source)))
a14770
input_files  := $(foreach file, $(ifile_list), sql/$(file).sql)
a14770
ofile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/output/*.source)))
a14770
output_files := $(foreach file, $(ofile_list), expected/$(file).out)
a14770
a14770
abs_srcdir := $(shell pwd)
a14770
abs_builddir := $(shell pwd)
a14770
a14770
check: installcheck-parallel
a14770
a14770
installcheck: cleandirs
a14770
	$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/serial_schedule $(EXTRA_TESTS)
a14770
a14770
installcheck-parallel: cleandirs
a14770
	$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
a14770
a14770
# The tests command the server to write into testtablespace and results.
a14770
# On a SELinux-enabled system this will fail unless we mark those directories
a14770
# as writable by the server.
a14770
cleandirs:
a14770
	-rm -rf testtablespace results
a14770
	mkdir testtablespace results
a14770
	if test -x /usr/bin/chcon && ! test -f /.dockerenv; then \
a14770
	    /usr/bin/chcon -u system_u -r object_r -t postgresql_db_t testtablespace results ; \
a14770
	fi
a14770
a14770
# old interfaces follow...
a14770
a14770
runcheck: check
a14770
runtest: installcheck
a14770
runtest-parallel: installcheck-parallel
a14770
a14770
a14770
##
a14770
## Clean up
a14770
##
a14770
a14770
clean distclean maintainer-clean:
a14770
	rm -f $(output_files) $(input_files)
a14770
	rm -rf testtablespace
a14770
	rm -rf results tmp_check log
a14770
	rm -f regression.diffs regression.out regress.out run_check.out