Skip to content

Commit 499a537

Browse files
committed
Avoid LDAP TAP tests when not built with LDAP
Since `run_misc_tests()` globs the test directories for test modules and runs them directly, the `if ($ENV{with_ldap} ne 'yes')` bits of the `Makefile` for `ldap_password_func`, at least, doesn't seem to trigger properly. So follow the precedent of checking for SSL configuration and skip LDAP tests when `--with-ldap` (or equivalent) hasn't been specified. This presumably wont't come up previously unless TAP tests were enabled and LDAP was not configured. While at it, fix a "Use of uninitialized value in pattern match" warning.
1 parent b99f853 commit 499a537

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

run_build.pl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2479,6 +2479,11 @@ sub run_misc_tests
24792479
? $config_opts->{openssl}
24802480
: (grep { $_ eq '--with-openssl' } @$config_opts);
24812481

2482+
my $using_ldap =
2483+
$using_msvc
2484+
? $config_opts->{ldap}
2485+
: (grep { $_ eq '--with-ldap' } @$config_opts);
2486+
24822487
## no critic (CodeLayout::ProhibitHardTabs)
24832488
foreach my $testdir (
24842489
glob(
@@ -2490,6 +2495,7 @@ sub run_misc_tests
24902495
{
24912496
my $testname = basename($testdir);
24922497
next if $testname =~ /ssl/ && !$using_ssl;
2498+
next if $testname =~ /ldap/ && !$using_ldap;
24932499
next unless -d "$testdir/t";
24942500
next if $using_msvc && $testname eq 'pg_bsd_indent';
24952501
next unless step_wanted("module-$testname");
@@ -2507,7 +2513,7 @@ sub run_misc_tests
25072513
next unless scalar glob("$testdir/*.o $testdir/*.obj");
25082514

25092515
# skip sepgsql unless it's marked for testing
2510-
next if $testname eq 'sepgsql' && $ENV{PG_TEST_EXTRA} !~ /\bsepgsql\b/;
2516+
next if $testname eq 'sepgsql' && ($ENV{PG_TEST_EXTRA} || '') !~ /\bsepgsql\b/;
25112517
next unless step_wanted("contrib-$testname");
25122518
print time_str(), "running contrib test $testname ...\n" if $verbose;
25132519
run_tap_test("$testdir", "contrib-$testname", undef);

0 commit comments

Comments
 (0)