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