summaryrefslogtreecommitdiffstats
path: root/Makefile.regress
blob: 1de43c40c22bf7414e173e10f73f760afbf0feee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# Simplified makefile for running the PostgreSQL regression tests
# in an RPM installation
#

# default encoding
MULTIBYTE = SQL_ASCII

# maximum simultaneous connections for parallel tests
MAXCONNOPT =
ifdef MAX_CONNECTIONS
MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
endif

# locale
NOLOCALE =
ifdef NO_LOCALE
NOLOCALE += --no-locale
endif

srcdir := .

# Test input and expected files.  These are created by pg_regress itself, so we
# don't have a rule to create them.  We do need rules to clean them however.
ifile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/input/*.source)))
input_files  := $(foreach file, $(ifile_list), sql/$(file).sql)
ofile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/output/*.source)))
output_files := $(foreach file, $(ofile_list), expected/$(file).out)

abs_srcdir := $(shell pwd)
abs_builddir := $(shell pwd)

check: installcheck-parallel

installcheck: cleandirs
	./pg_regress --schedule=$(srcdir)/serial_schedule --dlpath=. --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)

installcheck-parallel: cleandirs
	./pg_regress --schedule=$(srcdir)/parallel_schedule --dlpath=. --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)

# The tests command the server to write into testtablespace and results.
# On a SELinux-enabled system this will fail unless we mark those directories
# as writable by the server.
cleandirs:
	-rm -rf testtablespace results
	mkdir testtablespace results
	[ -x /usr/bin/chcon ] && /usr/bin/chcon -u system_u -r object_r -t postgresql_db_t testtablespace results

# old interfaces follow...

runcheck: check
runtest: installcheck
runtest-parallel: installcheck-parallel

bigtest: cleandirs
	./pg_regress --schedule=$(srcdir)/serial_schedule --dlpath=. --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) numeric_big

bigcheck: cleandirs
	./pg_regress --schedule=$(srcdir)/parallel_schedule --dlpath=. --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) numeric_big


##
## Clean up
##

clean distclean maintainer-clean:
	rm -f $(output_files) $(input_files)
	rm -rf testtablespace
	rm -rf results tmp_check log
	rm -f regression.diffs regression.out regress.out run_check.out