Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYs0U-00063i-E3 for pgsql-committers@arkaria.postgresql.org; Fri, 08 Oct 2021 15:41:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mYs0T-0003cB-CD for pgsql-committers@arkaria.postgresql.org; Fri, 08 Oct 2021 15:41:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYs0T-0003c3-6N for pgsql-committers@lists.postgresql.org; Fri, 08 Oct 2021 15:41:57 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYs0Q-0008Dt-Fp for pgsql-committers@lists.postgresql.org; Fri, 08 Oct 2021 15:41:56 +0000 Received: (Authenticated sender: adsend@dunslane.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 38097C0005; Fri, 8 Oct 2021 15:41:51 +0000 (UTC) Subject: Re: pgsql: Reference test binary using TESTDIR in 001_libpq_pipeline.pl. To: Andres Freund , pgsql-committers@lists.postgresql.org References: From: Andrew Dunstan Message-ID: <4941f5a5-2d50-1a0e-6701-14c5fefe92d6@dunslane.net> Date: Fri, 8 Oct 2021 11:41:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------B6A8E295C0A8D93509E90557" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------B6A8E295C0A8D93509E90557 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 10/1/21 6:34 PM, Andres Freund wrote: > Reference test binary using TESTDIR in 001_libpq_pipeline.pl. > > The previous approach didn't really work on windows, due to the PATH separator > being ';' not ':'. Instead of making the PATH change more complicated, > reference the binary using the TESTDIR environment. > > Reported-By: Andres Freund > Suggested-By: Andrew Dunstan > Discussion: https://postgr.es/m/20210930214040.odkdd42vknvzifm6@alap3.anarazel.de > Backpatch: 14-, where the test was introduced. > I don't think any of us were thinking very clearly about this. Of course, MSVC doesn't build executables in $TESTDIR. If we want to pick up the executable from where it's built we'll need a little help from vcregress.pl. I haven't tested it but What I have in mind is something like the attached. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com --------------B6A8E295C0A8D93509E90557 Content-Type: text/x-patch; charset=UTF-8; name="libpg_pipeline_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libpg_pipeline_fix.patch" diff --git a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl index 6721edfa71..7951600697 100644 --- a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl +++ b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl @@ -14,7 +14,15 @@ $node->init; $node->start; my $numrows = 700; -my $libpq_pipeline = "$ENV{TESTDIR}/libpq_pipeline"; +my $libpq_pipeline; +if (defined $ENV{MSBUILDDIR}) +{ + $libpq_pipeline = "$ENV{MSBUILDDIR}/libpq_pipeline/libpq_pipeline.exe"; +} +else +{ + $libpq_pipeline = "$ENV{TESTDIR}/libpq_pipeline"; +} my ($out, $err) = run_command([ $libpq_pipeline, 'tests' ]); die "oops: $err" unless $err eq ''; diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index 35e8f67f01..7d46b9f0cc 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -60,6 +60,7 @@ copy("$Config/regress/regress.dll", "src/test/regress"); copy("$Config/dummy_seclabel/dummy_seclabel.dll", "src/test/regress"); $ENV{PATH} = "$topdir/$Config/libpq;$ENV{PATH}"; +$ENV{MSBUILDDIR} = "$topdir/$Config"; if ($ENV{PERL5LIB}) { --------------B6A8E295C0A8D93509E90557--