diff options
| author | Peter Eisentraut | 2018-03-03 13:52:21 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2018-03-03 13:52:21 +0000 |
| commit | ff18115ae9dc2f2e54f5feb8cd9c493bd963a641 (patch) | |
| tree | 809e19761a15972f4c94cea1b9b739b68b33eb45 /src/test/ldap | |
| parent | fdb34824e01d14e21566806ea37e974ac61ef1a4 (diff) | |
Prevent LDAP and SSL tests from running without support in build
Add checks in each test file that the build supports the feature,
otherwise skip all the tests. Before, if someone were to (accidentally)
invoke these tests without build support, they would fail in confusing
ways.
based on patch from Michael Paquier <michael@paquier.xyz>
Diffstat (limited to 'src/test/ldap')
| -rw-r--r-- | src/test/ldap/Makefile | 2 | ||||
| -rw-r--r-- | src/test/ldap/t/001_auth.pl | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/test/ldap/Makefile b/src/test/ldap/Makefile index fef5742b82c..74fef48650b 100644 --- a/src/test/ldap/Makefile +++ b/src/test/ldap/Makefile @@ -13,6 +13,8 @@ subdir = src/test/ldap top_builddir = ../../.. include $(top_builddir)/src/Makefile.global +export with_ldap + check: $(prove_check) diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl index a83d96ae919..3a71e053538 100644 --- a/src/test/ldap/t/001_auth.pl +++ b/src/test/ldap/t/001_auth.pl @@ -2,7 +2,16 @@ use strict; use warnings; use TestLib; use PostgresNode; -use Test::More tests => 19; +use Test::More; + +if ($ENV{with_ldap} eq 'yes') +{ + plan tests => 19; +} +else +{ + plan skip_all => 'LDAP not supported by this build'; +} my ($slapd, $ldap_bin_dir, $ldap_schema_dir); |
