Re: convert libpq uri-regress tests to tap test

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: convert libpq uri-regress tests to tap test
Date: 2022-04-16 14:44:54
Message-ID: 20220416144454.GX26620@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 26, 2022 at 05:46:26PM -0800, Andres Freund wrote:
> Pushed. Attached is the remainder, 0003, the move of libpq_pipeline to
> src/interfaces/libpq that I'm not planning to push for now.

I saw that Andrew just pushed something to start building this under MSVC.

In case it's of any interest, I had done this differently a while back.
This probably doesn't apply except on top of some other patches, but you get
the idea.

commit 923f8a1c2cbea35cb01d1599caa2a81e3186181c
Author: Justin Pryzby <pryzbyj(at)telsasoft(dot)com>
Date: Mon Feb 28 01:31:10 2022 -0600

f!

ci-os-only: windows

diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 4364ab943fd..71ec747e544 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -44,6 +44,7 @@ my $contrib_extraincludes = {};
my $contrib_extrasource = {
'uri-regress' => ['src/interfaces/libpq/test/uri-regress.c'],
'testclient' => ['src/interfaces/libpq/test/testclient.c'],
+ 'libpq_pipeline' => ['src/interfaces/libpq/test/libpq_pipeline.c'],
};
my @contrib_excludes = (
'bool_plperl', 'commit_ts',
@@ -475,7 +476,7 @@ sub mkvcbuild
push @contrib_excludes, 'uuid-ossp';
}

- foreach my $subdir ('contrib', 'src/test/modules', 'src/interfaces/libpq')
+ foreach my $subdir ('contrib', 'src/test/modules') #, 'src/interfaces/libpq')
{
opendir($D, $subdir) || croak "Could not opendir on $subdir!\n";
while (my $d = readdir($D))
@@ -804,6 +805,20 @@ sub mkvcbuild
$p->AddReference($postgres);
}

+ $mf = Project::read_file('src/interfaces/libpq/test/Makefile');
+ $mf =~ s{\\\r?\n}{}g;
+ $mf =~ m{PROGRAMS\s*=\s*(.*)$}m
+ || die 'Could not match in src/interfaces/libpq/test/Makefile' . "\n";
+ foreach my $prg (split /\s+/, $1)
+ {
+ my $proj = $solution->AddProject($prg, 'exe', 'bin');
+ $proj->AddFile("src/interfaces/libpq/test/$prg.c"); # implicit source file
+ $proj->AddIncludeDir('src/interfaces/libpq');
+ # XXX: pipeline needs pgcommon and ws2, but uri-regress doesn't
+ $proj->AddReference($libpq, $libpgport, $libpgcommon);
+ $proj->AddLibrary('ws2_32.lib');
+ }
+
$mf = Project::read_file('src/bin/scripts/Makefile');
$mf =~ s{\\\r?\n}{}g;
$mf =~ m{PROGRAMS\s*=\s*(.*)$}m

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message dl x 2022-04-16 17:06:41 GSoC: pgmoneta: Write-Ahead Log (WAL) infrastructure (2022)
Previous Message vignesh C 2022-04-16 14:18:22 Re: Handle infinite recursion in logical replication setup