From 64e793fc19764dca1aea7f9d1bc276ccf9c687a1 Mon Sep 17 00:00:00 2001 From: tgl Date: Fri, 30 May 2008 00:04:32 +0000 Subject: [PATCH] =?utf8?q?Copy=20refint.so=20and=20autoinc.so=20into=20the?= =?utf8?q?=20src/test/regress=20directory=20during=20"make=20all",=20and?= =?utf8?q?=20then=20reference=20them=20there=20during=20the=20actual=20tes?= =?utf8?q?ts.=20=20This=20makes=20the=20handling=20of=20these=20files=20mo?= =?utf8?q?re=20parallel=20to=20that=20of=20regress.so,=20and=20in=20partic?= =?utf8?q?ular=20simplifies=20use=20of=20the=20regression=20tests=20outsid?= =?utf8?q?e=20the=20original=20build=20tree.=20=20The=20PGDG=20and=20Red?= =?utf8?q?=20Hat=20RPMs=20have=20been=20doing=20this=20via=20patches=20for?= =?utf8?q?=20a=20very=20long=20time.=20=20Inclusion=20of=20the=20change=20?= =?utf8?q?in=20core=20was=20requested=20by=20J=C3=B8rgen=20Austvik=20of=20?= =?utf8?q?Sun,=20and=20I=20can't=20see=20any=20reason=20not=20to.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I attempted to fix the MSVC scripts for this too, but they may need further tweaking ... --- doc/src/sgml/regress.sgml | 7 +++--- src/test/regress/GNUmakefile | 28 ++++++++++++++++-------- src/test/regress/input/create_function_1.source | 6 ++--- src/test/regress/output/create_function_1.source | 6 ++--- src/tools/msvc/clean.bat | 2 ++ src/tools/msvc/vcregress.pl | 4 ++-- 6 files changed, 32 insertions(+), 21 deletions(-) diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml index f0588c6d9f..10d81b21e6 100644 --- a/doc/src/sgml/regress.sgml +++ b/doc/src/sgml/regress.sgml @@ -48,9 +48,9 @@ gmake check script. At the end you should see something like -====================== - All 100 tests passed. -====================== +======================= + All 115 tests passed. +======================= or otherwise a note about which tests failed. See root# chmod -R a+w src/test/regress -root# chmod -R a+w contrib/spi root# su - joeuser joeuser$ cd top-level build directory joeuser$ gmake check diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile index 8581cdd934..f86c34e672 100644 --- a/src/test/regress/GNUmakefile +++ b/src/test/regress/GNUmakefile @@ -14,8 +14,6 @@ subdir = src/test/regress top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -contribdir = $(top_builddir)/contrib - # port number for temp-installation test postmaster TEMP_PORT = 5$(DEF_PGPORT) @@ -115,20 +113,33 @@ $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/% endif -# And finally some extra C modules... +# Get some extra C modules from contrib/spi... + +all: refint$(DLSUFFIX) autoinc$(DLSUFFIX) + +refint$(DLSUFFIX): $(top_builddir)/contrib/spi/refint$(DLSUFFIX) + cp $< $@ + +autoinc$(DLSUFFIX): $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX) + cp $< $@ -all: all-spi tablespace-setup +$(top_builddir)/contrib/spi/refint$(DLSUFFIX): $(top_srcdir)/contrib/spi/refint.c + $(MAKE) -C $(top_builddir)/contrib/spi refint$(DLSUFFIX) + +$(top_builddir)/contrib/spi/autoinc$(DLSUFFIX): $(top_srcdir)/contrib/spi/autoinc.c + $(MAKE) -C $(top_builddir)/contrib/spi autoinc$(DLSUFFIX) -.PHONY: all-spi -all-spi: - $(MAKE) -C $(contribdir)/spi refint$(DLSUFFIX) autoinc$(DLSUFFIX) # Tablespace setup + +all: tablespace-setup + .PHONY: tablespace-setup tablespace-setup: rm -rf ./testtablespace mkdir ./testtablespace + ## ## Run tests ## @@ -162,8 +173,7 @@ bigcheck: all clean distclean maintainer-clean: clean-lib # things built by `all' target - rm -f $(OBJS) - $(MAKE) -C $(contribdir)/spi clean + rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX) rm -f $(output_files) $(input_files) pg_regress_main.o pg_regress.o pg_regress$(X) # things created by various check targets rm -rf testtablespace diff --git a/src/test/regress/input/create_function_1.source b/src/test/regress/input/create_function_1.source index fb357d93b0..15de37ca26 100644 --- a/src/test/regress/input/create_function_1.source +++ b/src/test/regress/input/create_function_1.source @@ -24,17 +24,17 @@ CREATE FUNCTION int44out(city_budget) CREATE FUNCTION check_primary_key () RETURNS trigger - AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@' + AS '@abs_builddir@/refint@DLSUFFIX@' LANGUAGE C; CREATE FUNCTION check_foreign_key () RETURNS trigger - AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@' + AS '@abs_builddir@/refint@DLSUFFIX@' LANGUAGE C; CREATE FUNCTION autoinc () RETURNS trigger - AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@' + AS '@abs_builddir@/autoinc@DLSUFFIX@' LANGUAGE C; CREATE FUNCTION funny_dup17 () diff --git a/src/test/regress/output/create_function_1.source b/src/test/regress/output/create_function_1.source index 1b309cf11a..5c3779a225 100644 --- a/src/test/regress/output/create_function_1.source +++ b/src/test/regress/output/create_function_1.source @@ -25,15 +25,15 @@ CREATE FUNCTION int44out(city_budget) NOTICE: argument type city_budget is only a shell CREATE FUNCTION check_primary_key () RETURNS trigger - AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@' + AS '@abs_builddir@/refint@DLSUFFIX@' LANGUAGE C; CREATE FUNCTION check_foreign_key () RETURNS trigger - AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@' + AS '@abs_builddir@/refint@DLSUFFIX@' LANGUAGE C; CREATE FUNCTION autoinc () RETURNS trigger - AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@' + AS '@abs_builddir@/autoinc@DLSUFFIX@' LANGUAGE C; CREATE FUNCTION funny_dup17 () RETURNS trigger diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat index 353404e61d..0bb914cf65 100755 --- a/src/tools/msvc/clean.bat +++ b/src/tools/msvc/clean.bat @@ -65,6 +65,8 @@ if exist src\test\regress\tmp_check rd /s /q src\test\regress\tmp_check if exist contrib\spi\refint.dll del /q contrib\spi\refint.dll if exist contrib\spi\autoinc.dll del /q contrib\spi\autoinc.dll if exist src\test\regress\regress.dll del /q src\test\regress\regress.dll +if exist src\test\regress\refint.dll del /q src\test\regress\refint.dll +if exist src\test\regress\autoinc.dll del /q src\test\regress\autoinc.dll REM Clean up datafiles built with contrib REM cd contrib diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index c80b0816be..d6aa2ff0e3 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -36,8 +36,8 @@ else # use a capital C here because config.pl has $config my $Config = -e "release/postgres/postgres.exe" ? "Release" : "Debug"; -copy("$Config/refint/refint.dll","contrib/spi"); -copy("$Config/autoinc/autoinc.dll","contrib/spi"); +copy("$Config/refint/refint.dll","src/test/regress"); +copy("$Config/autoinc/autoinc.dll","src/test/regress"); copy("$Config/regress/regress.dll","src/test/regress"); $ENV{PATH} = "../../../$Config/libpq;../../$Config/libpq;$ENV{PATH}"; -- 2.11.4.GIT