Skip to content

Commit d1fe48b

Browse files
committed
wip: split TESTDIR into two
1 parent 184ec1a commit d1fe48b

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

src/Makefile.global.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,8 @@ echo "+++ tap install-check in $(subdir) +++" && \
454454
rm -rf '$(CURDIR)'/tmp_check && \
455455
$(MKDIR_P) '$(CURDIR)'/tmp_check && \
456456
cd $(srcdir) && \
457-
TESTDIR='$(CURDIR)' PATH="$(bindir):$(CURDIR):$$PATH" \
457+
TESTOUTDIR='$(CURDIR)/tmp_check' TESTDIR='$(CURDIR)' \
458+
PATH="$(bindir):$(CURDIR):$$PATH" \
458459
PGPORT='6$(DEF_PGPORT)' top_builddir='$(CURDIR)/$(top_builddir)' \
459460
PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
460461
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
@@ -465,8 +466,9 @@ echo "+++ tap install-check in $(subdir) +++" && \
465466
rm -rf '$(CURDIR)'/tmp_check && \
466467
$(MKDIR_P) '$(CURDIR)'/tmp_check && \
467468
cd $(srcdir) && \
468-
TESTDIR='$(CURDIR)' PATH="$(bindir):$(CURDIR):$$PATH" \
469-
PGPORT='6$(DEF_PGPORT)' top_builddir='$(top_builddir)' \
469+
TESTOUTDIR='$(CURDIR)/tmp_check' TESTDIR='$(CURDIR)' \
470+
PATH="$(bindir):$(CURDIR):$$PATH" PGPORT='6$(DEF_PGPORT)' \
471+
top_builddir='$(top_builddir)' \
470472
PG_REGRESS='$(top_builddir)/src/test/regress/pg_regress' \
471473
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
472474
endef
@@ -477,6 +479,7 @@ echo "+++ tap check in $(subdir) +++" && \
477479
rm -rf '$(CURDIR)'/tmp_check && \
478480
$(MKDIR_P) '$(CURDIR)'/tmp_check && \
479481
cd $(srcdir) && \
482+
TESTOUTDIR='$(CURDIR)/tmp_check' \
480483
TESTDIR='$(CURDIR)' $(with_temp_install) PGPORT='6$(DEF_PGPORT)' \
481484
PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
482485
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)

src/bin/psql/t/010_tab_completion.pl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@
7070
# to run in the build directory so that we can use relative paths to
7171
# access the tmp_check subdirectory; otherwise the output from filename
7272
# completion tests is too variable.
73-
if ($ENV{TESTDIR})
73+
if ($ENV{TESTOUTDIR})
7474
{
75-
chdir $ENV{TESTDIR} or die "could not chdir to \"$ENV{TESTDIR}\": $!";
75+
chdir "$ENV{TESTOUTDIR}" or die "could not chdir to \"$ENV{TESTOUTDIR}\": $!";
7676
}
7777

7878
# Create some junk files for filename completion testing.
7979
my $FH;
80-
open $FH, ">", "tmp_check/somefile"
81-
or die("could not create file \"tmp_check/somefile\": $!");
80+
open $FH, ">", "somefile"
81+
or die("could not create file \"somefile\": $!");
8282
print $FH "some stuff\n";
8383
close $FH;
84-
open $FH, ">", "tmp_check/afile123"
85-
or die("could not create file \"tmp_check/afile123\": $!");
84+
open $FH, ">", "afile123"
85+
or die("could not create file \"afile123\": $!");
8686
print $FH "more stuff\n";
8787
close $FH;
88-
open $FH, ">", "tmp_check/afile456"
89-
or die("could not create file \"tmp_check/afile456\": $!");
88+
open $FH, ">", "afile456"
89+
or die("could not create file \"afile456\": $!");
9090
print $FH "other stuff\n";
9191
close $FH;
9292

@@ -272,16 +272,16 @@ sub clear_line
272272

273273
# check filename completion
274274
check_completion(
275-
"\\lo_import tmp_check/some\t",
276-
qr|tmp_check/somefile |,
275+
"\\lo_import some\t",
276+
qr|somefile |,
277277
"filename completion with one possibility");
278278

279279
clear_query();
280280

281281
# note: readline might print a bell before the completion
282282
check_completion(
283-
"\\lo_import tmp_check/af\t",
284-
qr|tmp_check/af\a?ile|,
283+
"\\lo_import af\t",
284+
qr|af\a?ile|,
285285
"filename completion with multiple possibilities");
286286

287287
# broken versions of libedit require clear_line not clear_query here
@@ -291,23 +291,23 @@ sub clear_line
291291
# note: broken versions of libedit want to backslash the closing quote;
292292
# not much we can do about that
293293
check_completion(
294-
"COPY foo FROM tmp_check/some\t",
295-
qr|'tmp_check/somefile\\?' |,
294+
"COPY foo FROM some\t",
295+
qr|'somefile\\?' |,
296296
"quoted filename completion with one possibility");
297297

298298
clear_line();
299299

300300
check_completion(
301-
"COPY foo FROM tmp_check/af\t",
302-
qr|'tmp_check/afile|,
301+
"COPY foo FROM af\t",
302+
qr|'afile|,
303303
"quoted filename completion with multiple possibilities");
304304

305305
# some versions of readline/libedit require two tabs here, some only need one
306306
# also, some will offer the whole path name and some just the file name
307307
# the quotes might appear, too
308308
check_completion(
309309
"\t\t",
310-
qr|afile123'? +'?(tmp_check/)?afile456|,
310+
qr|afile123'? +'?afile456|,
311311
"offer multiple file choices");
312312

313313
clear_line();

src/test/perl/PostgreSQL/Test/Utils.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ INIT
192192
# Determine output directories, and create them. The base path is the
193193
# TESTDIR environment variable, which is normally set by the invoking
194194
# Makefile.
195-
$tmp_check = $ENV{TESTDIR} ? "$ENV{TESTDIR}/tmp_check" : "tmp_check";
195+
$tmp_check = $ENV{TESTOUTDIR} ? "$ENV{TESTOUTDIR}" : "tmp_check";
196196
$log_path = "$tmp_check/log";
197197

198198
mkdir $tmp_check;

src/tools/msvc/vcregress.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ sub tap_check
296296
# add the module build dir as the second element in the PATH
297297
$ENV{PATH} =~ s!;!;$topdir/$Config/$module;!;
298298

299+
$ENV{TESTOUTDIR} = "$dir/tmp_check";
300+
299301
rmtree('tmp_check');
300302
system(@args);
301303
my $status = $? >> 8;

0 commit comments

Comments
 (0)