]> granicus.if.org Git - postgresql/blob - src/test/regress/GNUmakefile
Back out regress/results changes. Real CVS problem worked-around.
[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.38 2002/07/02 05:43:34 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 override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
21 override CFLAGS += $(CFLAGS_SL)
22
23 override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
24
25
26 ##
27 ## Prepare for tests
28 ##
29
30 # Build regression test driver
31
32 all: pg_regress
33
34 pg_regress: pg_regress.sh GNUmakefile
35         sed -e 's,@bindir@,$(bindir),g' \
36             -e 's,@libdir@,$(libdir),g' \
37             -e 's,@pkglibdir@,$(pkglibdir),g' \
38             -e 's,@datadir@,$(datadir),g' \
39             -e 's/@VERSION@/$(VERSION)/g' \
40             -e 's/@host_tuple@/$(host_tuple)/g' \
41             -e 's,@GMAKE@,$(MAKE),g' \
42             -e 's/@enable_shared@/$(enable_shared)/g' \
43             -e 's/@GCC@/$(GCC)/g' \
44           $< >$@
45         chmod a+x $@
46
47
48 # Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE 'C'.
49
50 DLOBJS := regress$(DLSUFFIX)
51 # This is for some platforms
52 ifdef EXPSUFF
53 DLOBJS += regress$(EXPSUFF)
54 endif
55
56 all: $(DLOBJS)
57
58
59 # Build test input and expected files
60
61 file_list := copy create_function_1 create_function_2 misc constraints
62 input_files  := $(foreach file, $(file_list), sql/$(file).sql)
63 output_files := $(foreach file, $(file_list), expected/$(file).out)
64
65 all: $(input_files) $(output_files)
66
67 abs_srcdir := $(shell cd $(srcdir) && pwd)
68 abs_builddir := $(shell pwd)
69
70 define sed-command
71 sed -e 's,@abs_srcdir@,$(abs_srcdir),g' \
72     -e 's,@abs_builddir@,$(abs_builddir),g' \
73     -e 's/@DLSUFFIX@/$(DLSUFFIX)/g' $< >$@
74 endef
75
76 $(input_files): sql/%.sql: input/%.source
77         $(sed-command)
78
79 $(output_files): expected/%.out: output/%.source
80         $(sed-command)
81
82 # When doing a VPATH build, copy over the remaining .sql and .out
83 # files so that the driver script can find them.  We have to use an
84 # absolute path for the targets, because otherwise make will try to
85 # locate the missing files using VPATH, and will find them in
86 # $(srcdir), but the point here is that we want to copy them from
87 # $(srcdir) to the build directory.
88
89 ifdef VPATH
90 remaining_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) $(srcdir)/resultmap
91 remaining_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(remaining_files_src))
92
93 all: $(remaining_files_build)
94 $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
95         ln -s $< $@
96 endif
97
98
99 # And finally some extra C modules...
100
101 all: all-spi
102
103 .PHONY: all-spi
104 all-spi:
105         $(MAKE) -C $(contribdir)/spi REFINT_VERBOSE=1 refint$(DLSUFFIX) autoinc$(DLSUFFIX)
106
107
108 ##
109 ## Run tests
110 ##
111
112 check: all
113         $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE)
114
115 installcheck: all
116         $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)
117
118
119 # old interfaces follow...
120
121 runcheck: check
122 runtest: installcheck
123
124 bigtest:
125         $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) numeric_big
126
127 bigcheck:
128         $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) numeric_big
129
130
131 ##
132 ## Clean up
133 ##
134
135 clean distclean maintainer-clean:
136 # things built by `all' target
137         $(MAKE) -C $(contribdir)/spi clean
138         rm -f $(output_files) $(input_files) $(DLOBJS) regress.o pg_regress
139 # things created by various check targets
140         rm -rf results tmp_check log
141         rm -f regression.diffs regression.out regress.out run_check.out
142 ifeq ($(PORTNAME), win)
143         rm -f regress.def
144 endif
145 ifdef VPATH
146         rm -f $(remaining_files_build)
147 endif