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