src/test/perl/TestLib.pm: check_pg_config needs /usr/include/postgresql/pg_config.h

From: Christoph Berg <myon(at)debian(dot)org>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: src/test/perl/TestLib.pm: check_pg_config needs /usr/include/postgresql/pg_config.h
Date: 2020-05-08 19:16:44
Message-ID: 20200508191644.GA165095@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I believe check_pg_config as used by src/test/ssl/t/002_scram.pl
shouldn't rely on /usr/include/postgresql/pg_config.h but use the file
from the build tree instead:

src/test/perl/TestLib.pm:

Return the number of matches of the given regular expression
within the installation's C<pg_config.h>.

=cut

sub check_pg_config
{
my ($regexp) = @_;
my ($stdout, $stderr);
my $result = IPC::Run::run [ 'pg_config', '--includedir' ], '>',
\$stdout, '2>', \$stderr
or die "could not execute pg_config";
chomp($stdout);
$stdout =~ s/\r$//;

open my $pg_config_h, '<', "$stdout/pg_config.h" or die "$!"; <-- here
my $match = (grep { /^$regexp/ } <$pg_config_h>);
close $pg_config_h;
return $match;
}

src/test/ssl/README claims that it is possible to run the "ssl" extra
test from make check (as opposed to installcheck).

Christoph

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-05-08 19:34:31 Re: src/test/perl/TestLib.pm: check_pg_config needs /usr/include/postgresql/pg_config.h
Previous Message Pavel Stehule 2020-05-08 19:10:19 Re: JSON output from psql