Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b4a088

Browse files
committed
Change the sed rules in the regression test for pg_regress hackery to create
the generated files, to help Visual C++ to run these tests. The tests stillpass in VPATH and normal builds.Patch from Magnus Hagander, editorialized by me.
1 parent16f372d commit5b4a088

File tree

4 files changed

+192
-42
lines changed

4 files changed

+192
-42
lines changed

‎src/include/port.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.108 2007/01/11 02:39:52 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.109 2007/01/19 16:42:24 alvherre Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -46,6 +46,10 @@ extern void get_man_path(const char *my_exec_path, char *ret_path);
4646
externboolget_home_path(char*ret_path);
4747
externvoidget_parent_directory(char*path);
4848

49+
/* port/dirmod.c */
50+
externchar**pgfnames(char*path);
51+
externvoidpgfnames_cleanup(char**filenames);
52+
4953
/*
5054
*is_absolute_path
5155
*

‎src/port/dirmod.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*Win32 (NT, Win2k, XP).replace() doesn't work on Win95/98/Me.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.46 2007/01/05 22:20:02 momjian Exp $
13+
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.47 2007/01/19 16:42:24 alvherre Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -287,12 +287,14 @@ pgsymlink(const char *oldpath, const char *newpath)
287287

288288

289289
/*
290-
*fnames
290+
*pgfnames
291291
*
292-
* return a list of the names of objects in the argument directory
292+
* return a list of the names of objects in the argument directory. Caller
293+
* must call pgfnames_cleanup later to free the memory allocated by this
294+
* function.
293295
*/
294-
staticchar**
295-
fnames(char*path)
296+
char**
297+
pgfnames(char*path)
296298
{
297299
DIR*dir;
298300
structdirent*file;
@@ -357,12 +359,12 @@ fnames(char *path)
357359

358360

359361
/*
360-
*fnames_cleanup
362+
*pgfnames_cleanup
361363
*
362364
*deallocate memory used for filenames
363365
*/
364-
staticvoid
365-
fnames_cleanup(char**filenames)
366+
void
367+
pgfnames_cleanup(char**filenames)
366368
{
367369
char**fn;
368370

@@ -394,7 +396,7 @@ rmtree(char *path, bool rmtopdir)
394396
* we copy all the names out of the directory before we start modifying
395397
* it.
396398
*/
397-
filenames=fnames(path);
399+
filenames=pgfnames(path);
398400

399401
if (filenames==NULL)
400402
return false;
@@ -415,7 +417,7 @@ rmtree(char *path, bool rmtopdir)
415417
if (!rmtree(filepath, true))
416418
{
417419
/* we already reported the error */
418-
fnames_cleanup(filenames);
420+
pgfnames_cleanup(filenames);
419421
return false;
420422
}
421423
}
@@ -433,7 +435,7 @@ rmtree(char *path, bool rmtopdir)
433435
gotoreport_and_fail;
434436
}
435437

436-
fnames_cleanup(filenames);
438+
pgfnames_cleanup(filenames);
437439
return true;
438440

439441
report_and_fail:
@@ -444,6 +446,6 @@ rmtree(char *path, bool rmtopdir)
444446
fprintf(stderr,_("could not remove file or directory \"%s\": %s\n"),
445447
filepath,strerror(errno));
446448
#endif
447-
fnames_cleanup(filenames);
449+
pgfnames_cleanup(filenames);
448450
return false;
449451
}

‎src/test/regress/GNUmakefile

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Portions Copyright (c) 1996-2007, 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.63 2007/01/05 22:20:03 momjian Exp $
9+
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.64 2007/01/19 16:42:24 alvherre Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -40,7 +40,8 @@ endif
4040
# stuff to pass into build of pg_regress
4141
EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"'\
4242
'-DMAKEPROG="$(MAKE)"'\
43-
'-DSHELLPROG="$(SHELL)"'
43+
'-DSHELLPROG="$(SHELL)"'\
44+
'-DDLSUFFIX="$(DLSUFFIX)"'
4445

4546
##
4647
## Prepare for tests
@@ -83,14 +84,12 @@ $(NAME)$(DLSUFFIX): $(shlib)
8384
rm -f$(NAME)$(DLSUFFIX)
8485
$(LN_S)$(shlib)$(NAME)$(DLSUFFIX)
8586

86-
#Build testinput and expected files
87-
88-
file_list :=copy create_function_1 create_function_2 misc constraints tablespace
87+
#Testinput and expected files. These are created by pg_regress itself, so we
88+
# don't have a rule to create them. We do need rules to clean them however.
89+
file_list :=$(subst .source,,$(notdir$(wildcard$(top_srcdir)/$(subdir)/input/*.source)))
8990
input_files :=$(foreach file,$(file_list), sql/$(file).sql)
9091
output_files :=$(foreach file,$(file_list), expected/$(file).out)
9192

92-
all:$(input_files)$(output_files)
93-
9493
ifneq ($(PORTNAME),win32)
9594
abs_srcdir :=$(shell cd$(srcdir) && pwd)
9695
abs_builddir :=$(shell pwd)
@@ -99,22 +98,6 @@ abs_srcdir := $(shell cd $(srcdir) && pwd -W)
9998
abs_builddir :=$(shell pwd -W)
10099
endif
101100

102-
testtablespace :=$(abs_builddir)/testtablespace
103-
104-
105-
definesed-command
106-
sed -e 's,@abs_srcdir@,$(abs_srcdir),g' \
107-
-e 's,@abs_builddir@,$(abs_builddir),g' \
108-
-e 's,@testtablespace@,$(testtablespace),g' \
109-
-e 's/@DLSUFFIX@/$(DLSUFFIX)/g'$< >$@
110-
endef
111-
112-
$(input_files): sql/%.sql: input/%.source
113-
$(sed-command)
114-
115-
$(output_files): expected/%.out: output/%.source
116-
$(sed-command)
117-
118101
# When doing a VPATH build, copy over the remaining .sql and .out
119102
# files so that the driver script can find them. We have to use an
120103
# absolute path for the targets, because otherwise make will try to
@@ -148,17 +131,17 @@ all-spi:
148131
check: all
149132
-rm -rf ./testtablespace
150133
mkdir ./testtablespace
151-
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql$(MAXCONNOPT)$(NOLOCALE)
134+
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql$(MAXCONNOPT)$(NOLOCALE)
152135

153136
installcheck: all
154137
-rm -rf ./testtablespace
155138
mkdir ./testtablespace
156-
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE)
139+
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE)
157140

158141
installcheck-parallel: all
159142
-rm -rf ./testtablespace
160143
mkdir ./testtablespace
161-
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql$(MAXCONNOPT)$(NOLOCALE)
144+
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql$(MAXCONNOPT)$(NOLOCALE)
162145

163146

164147
# old interfaces follow...
@@ -168,10 +151,10 @@ runtest: installcheck
168151
runtest-parallel: installcheck-parallel
169152

170153
bigtest:
171-
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE) numeric_big
154+
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE) numeric_big
172155

173156
bigcheck:
174-
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql$(MAXCONNOPT)$(NOLOCALE) numeric_big
157+
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql$(MAXCONNOPT)$(NOLOCALE) numeric_big
175158

176159

177160
##

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp