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

Commite78900a

Browse files
committed
Create by default sql/ and expected/ for output directory in pg_regress
Using --outputdir with a custom output repository has never created bydefault the sql/ and expected/ paths generated with contents fromrespectively input/ and output/ if they don't exist, while the baseoutput directory gets created if it does not exist. If sql/ andexpected/ are not present, pg_regress would fail with the path missing,requiring test scripts to create those extra paths by themselves. Thiscommit changes pg_regress so as both get created by default if they donot exist, removing the need for external test scripts to do so.This cleans up two code paths in the tree for pg_upgrade tests in MSVCand environments able to use test.sh. sql/ and expected/ were createdas part of each test script, but this is not needed anymore aspg_regress handles the work now.Author: Roman Zharkov, Daniel GustafssonReviewed-by: Michael Paquier, Tom LaneDiscussion:https://postgr.es/m/16484-4d89e9cc11241996@postgresql.org
1 parent6472572 commite78900a

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

‎src/bin/pg_upgrade/test.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ outputdir="$temp_root/regress"
106106
EXTRA_REGRESS_OPTS="$EXTRA_REGRESS_OPTS --outputdir=$outputdir"
107107
export EXTRA_REGRESS_OPTS
108108
mkdir"$outputdir"
109-
mkdir"$outputdir"/sql
110-
mkdir"$outputdir"/expected
111109
mkdir"$outputdir"/testtablespace
112110

113111
logdir=`pwd`/log

‎src/test/regress/pg_regress.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,17 +465,15 @@ convert_sourcefiles_in(const char *source_subdir, const char *dest_dir, const ch
465465
{
466466
chartesttablespace[MAXPGPATH];
467467
charindir[MAXPGPATH];
468-
structstatst;
469-
intret;
468+
charoutdir_sub[MAXPGPATH];
470469
char**name;
471470
char**names;
472471
intcount=0;
473472

474473
snprintf(indir,MAXPGPATH,"%s/%s",inputdir,source_subdir);
475474

476475
/* Check that indir actually exists and is a directory */
477-
ret=stat(indir,&st);
478-
if (ret!=0|| !S_ISDIR(st.st_mode))
476+
if (!directory_exists(indir))
479477
{
480478
/*
481479
* No warning, to avoid noise in tests that do not have these
@@ -489,6 +487,11 @@ convert_sourcefiles_in(const char *source_subdir, const char *dest_dir, const ch
489487
/* Error logged in pgfnames */
490488
exit(2);
491489

490+
/* Create the "dest" subdirectory if not present */
491+
snprintf(outdir_sub,MAXPGPATH,"%s/%s",dest_dir,dest_subdir);
492+
if (!directory_exists(outdir_sub))
493+
make_directory(outdir_sub);
494+
492495
snprintf(testtablespace,MAXPGPATH,"%s/testtablespace",outputdir);
493496

494497
#ifdefWIN32

‎src/tools/msvc/vcregress.pl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,6 @@ sub upgradecheck
571571
my$outputdir ="$tmp_root/regress";
572572
my@EXTRA_REGRESS_OPTS = ("--outputdir=$outputdir");
573573
mkdir"$outputdir" ||die$!;
574-
mkdir"$outputdir/sql" ||die$!;
575-
mkdir"$outputdir/expected" ||die$!;
576574
mkdir"$outputdir/testtablespace" ||die$!;
577575

578576
my$logdir ="$topdir/src/bin/pg_upgrade/log";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp