Reference test binary using TESTDIR in 001_libpq_pipeline.pl.
authorAndres Freund <[email protected]>
Thu, 30 Sep 2021 01:02:32 +0000 (18:02 -0700)
committerAndres Freund <[email protected]>
Fri, 1 Oct 2021 22:30:16 +0000 (15:30 -0700)
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 <[email protected]>
Suggested-By: Andrew Dunstan <[email protected]>
Discussion: https://postgr.es/m/20210930214040[email protected]
Backpatch: 14-, where the test was introduced.

src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl

index 49f211c827047127f327ea61057ca47b72c5b0e7..6721edfa719a05e2a2ac066c1e58f0c1ec5734a3 100644 (file)
@@ -14,9 +14,9 @@ $node->init;
 $node->start;
 
 my $numrows = 700;
-$ENV{PATH} = "$ENV{TESTDIR}:$ENV{PATH}";
+my $libpq_pipeline = "$ENV{TESTDIR}/libpq_pipeline";
 
-my ($out, $err) = run_command([ 'libpq_pipeline', 'tests' ]);
+my ($out, $err) = run_command([ $libpq_pipeline, 'tests' ]);
 die "oops: $err" unless $err eq '';
 my @tests = split(/\s+/, $out);
 
@@ -39,8 +39,8 @@ for my $testname (@tests)
    # Execute the test
    $node->command_ok(
        [
-           'libpq_pipeline', @extraargs,
-           $testname,        $node->connstr('postgres')
+           $libpq_pipeline, @extraargs,
+           $testname,       $node->connstr('postgres')
        ],
        "libpq_pipeline $testname");