Skip to content

Commit c47885b

Browse files
committed
Split TESTDIR into TESTLOGDIR and TESTDATADIR
The motivation for this is twofold. For one the meson patchset would like to have more control over the logfiles. For another, the log file location for tap tests (tmp_check/log) is not symmetric to the log location for pg_regress/isolation tests (log/). This commit does not change the default location for log files for tap tests, as that'd break the buildfarm log collection, it just provides the infrastructure for doing so. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://postgr.es/m/1131990.1660661896@sss.pgh.pa.us Discussion: https://postgr.es/m/20220828170806.GN2342@telsasoft.com
1 parent bb54bf2 commit c47885b

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

src/Makefile.global.in

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,9 @@ echo "+++ tap install-check in $(subdir) +++" && \
451451
rm -rf '$(CURDIR)'/tmp_check && \
452452
$(MKDIR_P) '$(CURDIR)'/tmp_check && \
453453
cd $(srcdir) && \
454-
TESTDIR='$(CURDIR)/tmp_check' PATH="$(bindir):$(CURDIR):$$PATH" \
454+
TESTLOGDIR='$(CURDIR)/tmp_check/log' \
455+
TESTDATADIR='$(CURDIR)/tmp_check' \
456+
PATH="$(bindir):$(CURDIR):$$PATH" \
455457
PGPORT='6$(DEF_PGPORT)' top_builddir='$(CURDIR)/$(top_builddir)' \
456458
PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
457459
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
@@ -462,7 +464,9 @@ echo "+++ tap install-check in $(subdir) +++" && \
462464
rm -rf '$(CURDIR)'/tmp_check && \
463465
$(MKDIR_P) '$(CURDIR)'/tmp_check && \
464466
cd $(srcdir) && \
465-
TESTDIR='$(CURDIR)/tmp_check' PATH="$(bindir):$(CURDIR):$$PATH" \
467+
TESTLOGDIR='$(CURDIR)/tmp_check/log' \
468+
TESTDATADIR='$(CURDIR)/tmp_check' \
469+
PATH="$(bindir):$(CURDIR):$$PATH" \
466470
PGPORT='6$(DEF_PGPORT)' top_builddir='$(top_builddir)' \
467471
PG_REGRESS='$(top_builddir)/src/test/regress/pg_regress' \
468472
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
@@ -474,7 +478,10 @@ echo "+++ tap check in $(subdir) +++" && \
474478
rm -rf '$(CURDIR)'/tmp_check && \
475479
$(MKDIR_P) '$(CURDIR)'/tmp_check && \
476480
cd $(srcdir) && \
477-
TESTDIR='$(CURDIR)/tmp_check' $(with_temp_install) PGPORT='6$(DEF_PGPORT)' \
481+
TESTLOGDIR='$(CURDIR)/tmp_check/log' \
482+
TESTDATADIR='$(CURDIR)/tmp_check' \
483+
$(with_temp_install) \
484+
PGPORT='6$(DEF_PGPORT)' \
478485
PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
479486
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
480487
endef

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

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

7878
# Create some junk files for filename completion testing.

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ INIT
189189
# test may still fail, but it's more likely to report useful facts.
190190
$SIG{PIPE} = 'IGNORE';
191191

192-
# Determine output directories, and create them. The base path is the
193-
# TESTDIR environment variable, which is normally set by the invoking
194-
# Makefile.
195-
$tmp_check = $ENV{TESTDIR} ? "$ENV{TESTDIR}" : "tmp_check";
196-
$log_path = "$tmp_check/log";
192+
# Determine output directories, and create them. The base paths are the
193+
# TESTDATADIR / TESTLOGDIR environment variables, which are normally set
194+
# by the invoking Makefile.
195+
$tmp_check = $ENV{TESTDATADIR} ? "$ENV{TESTDATADIR}" : "tmp_check";
196+
$log_path = $ENV{TESTLOGDIR} ? "$ENV{TESTLOGDIR}" : "log";
197197

198198
mkdir $tmp_check;
199199
mkdir $log_path;

src/tools/msvc/vcregress.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ sub tap_check
291291
$ENV{PG_REGRESS} = "$topdir/$Config/pg_regress/pg_regress";
292292
$ENV{REGRESS_SHLIB} = "$topdir/src/test/regress/regress.dll";
293293

294-
$ENV{TESTDIR} = "$dir/tmp_check";
294+
$ENV{TESTDATADIR} = "$dir/tmp_check";
295+
$ENV{TESTLOGDIR} = "$dir/tmp_check/log";
296+
295297
my $module = basename $dir;
296298
# add the module build dir as the second element in the PATH
297299
$ENV{PATH} =~ s!;!;$topdir/$Config/$module;!;

0 commit comments

Comments
 (0)