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