Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bf4bd50

Browse files
committed
Copy refint.so and autoinc.so into the src/test/regress directory during
"make all", and then reference them there during the actual tests. This makes the handling of these files more parallel to that of regress.so, and in particular simplifies use of the regression tests outside the original build tree. The PGDG and Red Hat RPMs have been doing this via patches for a very long time. Inclusion of the change in core was requested by Jørgen Austvik of Sun, and I can't see any reason not to. I attempted to fix the MSVC scripts for this too, but they may need further tweaking ...
1 parent d11e301 commit bf4bd50

File tree

6 files changed

+36
-25
lines changed

6 files changed

+36
-25
lines changed

doc/src/sgml/regress.sgml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.58 2007/06/12 17:49:12 mha Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.59 2008/05/30 00:04:32 tgl Exp $ -->
22

33
<chapter id="regress">
44
<title id="regress-title">Regression Tests</title>
@@ -48,9 +48,9 @@ gmake check
4848
script. At the end you should see something like
4949
<screen>
5050
<computeroutput>
51-
======================
52-
All 100 tests passed.
53-
======================
51+
=======================
52+
All 115 tests passed.
53+
=======================
5454
</computeroutput>
5555
</screen>
5656
or otherwise a note about which tests failed. See <xref
@@ -67,7 +67,6 @@ gmake check
6767
For example
6868
<screen>
6969
<prompt>root# </prompt><userinput>chmod -R a+w src/test/regress</userinput>
70-
<prompt>root# </prompt><userinput>chmod -R a+w contrib/spi</userinput>
7170
<prompt>root# </prompt><userinput>su - joeuser</userinput>
7271
<prompt>joeuser$ </prompt><userinput>cd <replaceable>top-level build directory</></userinput>
7372
<prompt>joeuser$ </prompt><userinput>gmake check</userinput>

src/test/regress/GNUmakefile

+20-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
77
# Portions Copyright (c) 1994, Regents of the University of California
88
#
9-
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.73 2008/04/07 14:15:58 petere Exp $
9+
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.74 2008/05/30 00:04:32 tgl Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

1313
subdir = src/test/regress
1414
top_builddir = ../../..
1515
include $(top_builddir)/src/Makefile.global
1616

17-
contribdir = $(top_builddir)/contrib
18-
1917
# port number for temp-installation test postmaster
2018
TEMP_PORT = 5$(DEF_PGPORT)
2119

@@ -115,20 +113,33 @@ $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
115113
endif
116114

117115

118-
# And finally some extra C modules...
116+
# Get some extra C modules from contrib/spi...
117+
118+
all: refint$(DLSUFFIX) autoinc$(DLSUFFIX)
119+
120+
refint$(DLSUFFIX): $(top_builddir)/contrib/spi/refint$(DLSUFFIX)
121+
cp $< $@
122+
123+
autoinc$(DLSUFFIX): $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX)
124+
cp $< $@
119125

120-
all: all-spi tablespace-setup
126+
$(top_builddir)/contrib/spi/refint$(DLSUFFIX): $(top_srcdir)/contrib/spi/refint.c
127+
$(MAKE) -C $(top_builddir)/contrib/spi refint$(DLSUFFIX)
128+
129+
$(top_builddir)/contrib/spi/autoinc$(DLSUFFIX): $(top_srcdir)/contrib/spi/autoinc.c
130+
$(MAKE) -C $(top_builddir)/contrib/spi autoinc$(DLSUFFIX)
121131

122-
.PHONY: all-spi
123-
all-spi:
124-
$(MAKE) -C $(contribdir)/spi refint$(DLSUFFIX) autoinc$(DLSUFFIX)
125132

126133
# Tablespace setup
134+
135+
all: tablespace-setup
136+
127137
.PHONY: tablespace-setup
128138
tablespace-setup:
129139
rm -rf ./testtablespace
130140
mkdir ./testtablespace
131141

142+
132143
##
133144
## Run tests
134145
##
@@ -162,8 +173,7 @@ bigcheck: all
162173

163174
clean distclean maintainer-clean: clean-lib
164175
# things built by `all' target
165-
rm -f $(OBJS)
166-
$(MAKE) -C $(contribdir)/spi clean
176+
rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX)
167177
rm -f $(output_files) $(input_files) pg_regress_main.o pg_regress.o pg_regress$(X)
168178
# things created by various check targets
169179
rm -rf testtablespace

src/test/regress/input/create_function_1.source

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ CREATE FUNCTION int44out(city_budget)
2424

2525
CREATE FUNCTION check_primary_key ()
2626
RETURNS trigger
27-
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
27+
AS '@abs_builddir@/refint@DLSUFFIX@'
2828
LANGUAGE C;
2929

3030
CREATE FUNCTION check_foreign_key ()
3131
RETURNS trigger
32-
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
32+
AS '@abs_builddir@/refint@DLSUFFIX@'
3333
LANGUAGE C;
3434

3535
CREATE FUNCTION autoinc ()
3636
RETURNS trigger
37-
AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@'
37+
AS '@abs_builddir@/autoinc@DLSUFFIX@'
3838
LANGUAGE C;
3939

4040
CREATE FUNCTION funny_dup17 ()

src/test/regress/output/create_function_1.source

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ CREATE FUNCTION int44out(city_budget)
2525
NOTICE: argument type city_budget is only a shell
2626
CREATE FUNCTION check_primary_key ()
2727
RETURNS trigger
28-
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
28+
AS '@abs_builddir@/refint@DLSUFFIX@'
2929
LANGUAGE C;
3030
CREATE FUNCTION check_foreign_key ()
3131
RETURNS trigger
32-
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
32+
AS '@abs_builddir@/refint@DLSUFFIX@'
3333
LANGUAGE C;
3434
CREATE FUNCTION autoinc ()
3535
RETURNS trigger
36-
AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@'
36+
AS '@abs_builddir@/autoinc@DLSUFFIX@'
3737
LANGUAGE C;
3838
CREATE FUNCTION funny_dup17 ()
3939
RETURNS trigger

src/tools/msvc/clean.bat

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
REM $PostgreSQL: pgsql/src/tools/msvc/clean.bat,v 1.10 2008/02/06 15:13:25 mha Exp $
2+
REM $PostgreSQL: pgsql/src/tools/msvc/clean.bat,v 1.11 2008/05/30 00:04:32 tgl Exp $
33

44
set DIST=0
55
if "%1"=="dist" set DIST=1
@@ -65,6 +65,8 @@ if exist src\test\regress\tmp_check rd /s /q src\test\regress\tmp_check
6565
if exist contrib\spi\refint.dll del /q contrib\spi\refint.dll
6666
if exist contrib\spi\autoinc.dll del /q contrib\spi\autoinc.dll
6767
if exist src\test\regress\regress.dll del /q src\test\regress\regress.dll
68+
if exist src\test\regress\refint.dll del /q src\test\regress\refint.dll
69+
if exist src\test\regress\autoinc.dll del /q src\test\regress\autoinc.dll
6870

6971
REM Clean up datafiles built with contrib
7072
REM cd contrib

src/tools/msvc/vcregress.pl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# -*-perl-*- hey - emacs - this is a perl file
33

4-
# $PostgreSQL: pgsql/src/tools/msvc/vcregress.pl,v 1.6 2007/11/13 22:49:47 tgl Exp $
4+
# $PostgreSQL: pgsql/src/tools/msvc/vcregress.pl,v 1.7 2008/05/30 00:04:32 tgl Exp $
55

66
use strict;
77

@@ -36,8 +36,8 @@
3636
# use a capital C here because config.pl has $config
3737
my $Config = -e "release/postgres/postgres.exe" ? "Release" : "Debug";
3838

39-
copy("$Config/refint/refint.dll","contrib/spi");
40-
copy("$Config/autoinc/autoinc.dll","contrib/spi");
39+
copy("$Config/refint/refint.dll","src/test/regress");
40+
copy("$Config/autoinc/autoinc.dll","src/test/regress");
4141
copy("$Config/regress/regress.dll","src/test/regress");
4242

4343
$ENV{PATH} = "../../../$Config/libpq;../../$Config/libpq;$ENV{PATH}";

0 commit comments

Comments
 (0)