]> granicus.if.org Git - postgresql/blob - src/test/regress/GNUmakefile
The following patch was sent to the patches list:
[postgresql] / src / test / regress / GNUmakefile
1 #-------------------------------------------------------------------------
2 #
3 # GNUmakefile--
4 #    Makefile for regress (the regression tests)
5 #
6 # Copyright (c) 1994, Regents of the University of California
7 #
8 #
9 # IDENTIFICATION
10 #    $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.27 2000/10/18 16:16:14 momjian Exp $
11 #
12 #-------------------------------------------------------------------------
13
14 subdir = src/test/regress
15 top_builddir = ../../..
16 include $(top_builddir)/src/Makefile.global
17
18 contribdir := $(top_builddir)/contrib
19
20 CFLAGS+= -I$(libpq_srcdir) $(CFLAGS_SL)
21
22 LDADD+= $(libpq)
23
24
25 ##
26 ## Prepare for tests
27 ##
28
29 # Build regression test driver
30
31 all: pg_regress
32
33 pg_regress: pg_regress.sh GNUmakefile
34         sed -e 's,@bindir@,$(bindir),g' \
35             -e 's,@libdir@,$(libdir),g' \
36             -e 's,@datadir@,$(datadir),g' \
37             -e 's/@VERSION@/$(VERSION)/g' \
38             -e 's/@host_tuple@/$(host_tuple)/g' \
39             -e 's,@GMAKE@,$(MAKE),g' \
40           $< >$@
41         chmod a+x $@
42
43
44 # Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE 'C'.
45
46 DLOBJS := regress$(DLSUFFIX)
47 # This is for some platforms
48 ifdef EXPSUFF
49 DLOBJS += regress$(EXPSUFF)
50 endif
51
52 all: $(DLOBJS)
53
54
55 # Build test input and expected files
56
57 file_list := copy create_function_1 create_function_2 misc constraints
58 input_files  := $(foreach file, $(file_list), sql/$(file).sql)
59 output_files := $(foreach file, $(file_list), expected/$(file).out)
60
61 all: $(input_files) $(output_files)
62
63 sql/%.sql: input/%.source
64         pwd=`pwd` && sed "s,_OBJWD_,$$pwd,g;s/_DLSUFFIX_/$(DLSUFFIX)/g" $(srcdir)/$< >$@
65
66 expected/%.out: output/%.source
67         pwd=`pwd` && sed "s,_OBJWD_,$$pwd,g;s/_DLSUFFIX_/$(DLSUFFIX)/g" $(srcdir)/$< >$@
68
69
70 # And finally some extra C modules...
71
72 all: all-spi
73
74 .PHONY: all-spi
75 all-spi:
76         $(MAKE) -C $(contribdir)/spi REFINT_VERBOSE=1 refint$(DLSUFFIX) autoinc$(DLSUFFIX)
77
78
79 ##
80 ## Run tests
81 ##
82
83 check: all
84         $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=parallel_schedule --multibyte=$(MULTIBYTE)
85
86 installcheck: all
87         $(SHELL) ./pg_regress --schedule=serial_schedule --multibyte=$(MULTIBYTE)
88
89
90 # old interfaces follow...
91
92 #
93 # huge extra tests run in target bigtest
94 #
95 EXTRA_TESTS     = numeric_big
96
97 #
98 # run the tests
99 #
100 runtest: all
101 ifneq ($(PORTNAME), win)
102         MULTIBYTE=$(MULTIBYTE);export MULTIBYTE; \
103         $(SHELL) ./regress.sh $(host_tuple) 2>&1 | tee regress.out
104 else
105         MULTIBYTE=$(MULTIBYTE);export MULTIBYTE; \
106         ./regress.sh $(host_tuple) 2>&1 | tee regress.out
107 endif
108         @echo "ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILE regress.out"
109         @echo ""
110         @echo "To run the optional big test(s) too, type 'make bigtest'"
111         @echo "These big tests can take over an hour to complete"
112         @echo "These actually are: $(EXTRA_TESTS)"
113
114 #
115 # run the test including the huge extra tests
116 #
117 bigtest: all
118 ifneq ($(PORTNAME), win)
119         MULTIBYTE=$(MULTIBYTE);export MULTIBYTE; \
120         $(SHELL) ./regress.sh $(host_tuple) $(EXTRA_TESTS) 2>&1 | tee regress.out
121 else
122         MULTIBYTE=$(MULTIBYTE);export MULTIBYTE; \
123         ./regress.sh $(host_tuple) $(EXTRA_TESTS) 2>&1 | tee regress.out
124 endif
125         @echo "ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILE regress.out"
126
127 #
128 # run the parallel test suite
129 #
130 runcheck: all
131 ifneq ($(PORTNAME), win)
132         MULTIBYTE=$(MULTIBYTE);export MULTIBYTE; \
133         MAKE=$(MAKE);export MAKE; \
134         $(SHELL) ./run_check.sh $(host_tuple)
135 else
136         MULTIBYTE=$(MULTIBYTE);export MULTIBYTE; \
137         MAKE=$(MAKE);export MAKE; \
138         ./run_check.sh $(host_tuple)
139 endif
140         @echo "ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILES run_check.out"
141         @echo "AND regress.out"
142         @echo ""
143         @echo "To run the optional big test(s) too, type 'make bigcheck'"
144         @echo "These big tests can take over an hour to complete"
145         @echo "These actually are: $(EXTRA_TESTS)"
146
147 #
148 # run the test including the huge extra tests
149 #
150 bigcheck: all
151 ifneq ($(PORTNAME), win)
152         MULTIBYTE=$(MULTIBYTE);export MULTIBYTE; \
153         MAKE=$(MAKE);export MAKE; \
154         $(SHELL) ./run_check.sh $(host_tuple) $(EXTRA_TESTS)
155 else
156         MULTIBYTE=$(MULTIBYTE);export MULTIBYTE; \
157         MAKE=$(MAKE);export MAKE; \
158         ./run_check.sh $(host_tuple) $(EXTRA_TESTS)
159 endif
160         @echo "ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILES run_check.out"
161         @echo "AND regress.out"
162
163
164 # clean up
165
166 clean distclean maintainer-clean:
167 # things built by `all' target
168         $(MAKE) -C $(contribdir)/spi clean
169         rm -f $(output_files) $(input_files) $(DLOBJS) regress.o pg_regress
170 # things created by various check targets
171         rm -rf results tmp_check log
172         rm -f regression.diffs regression.out regress.out run_check.out
173 ifeq ($(PORTNAME), win)
174         rm -f regress.def
175 endif