Skip to content

Commit ee56c3b

Browse files
committed
ldap tests: Don't run on unsupported operating systems.
The tests currently fail on unsupported operating systems, rather than getting skipped. The ony reason this doesn't cause problems is that the tests aren't run by default. Discussion: https://postgr.es/m/[email protected]
1 parent 2cfde3c commit ee56c3b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/test/ldap/t/001_auth.pl

+10-5
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66
use PostgreSQL::Test::Utils;
77
use PostgreSQL::Test::Cluster;
88
use Test::More;
9+
use Config;
910

10-
if ($ENV{with_ldap} ne 'yes')
11-
{
12-
plan skip_all => 'LDAP not supported by this build';
13-
}
1411

1512
my ($slapd, $ldap_bin_dir, $ldap_schema_dir);
1613

1714
$ldap_bin_dir = undef; # usually in PATH
1815

19-
if ($^O eq 'darwin' && -d '/usr/local/opt/openldap')
16+
if ($ENV{with_ldap} ne 'yes')
17+
{
18+
plan skip_all => 'LDAP not supported by this build';
19+
}
20+
elsif ($^O eq 'darwin' && -d '/usr/local/opt/openldap')
2021
{
2122
# typical paths for Homebrew
2223
$slapd = '/usr/local/opt/openldap/libexec/slapd';
@@ -39,6 +40,10 @@
3940
$slapd = '/usr/local/libexec/slapd';
4041
$ldap_schema_dir = '/usr/local/etc/openldap/schema';
4142
}
43+
else
44+
{
45+
plan skip_all => "ldap tests not supported on $^O or dependencies not installed";
46+
}
4247

4348
# make your own edits here
4449
#$slapd = '';

0 commit comments

Comments
 (0)