Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2011-03-26 17:16:16 +0100
committerArthur de Jong <arthur@arthurdejong.org>2011-03-26 17:16:16 +0100
commitf3ccc1018357b4d26ad348c264ef29d68b3610bb (patch)
treea12cbe3a74a1829e8a7a371983c05e0cd5bfbcb7 /tests
parentfa2099bfd7e94f377f3f68423dfa7dcc645b158a (diff)
ensure that all test source files are distibuted and can tests can be run when source directory differs from build directory
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1416 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am12
-rwxr-xr-xtests/test_nsscmds.sh6
-rwxr-xr-xtests/test_pamcmds.sh5
3 files changed, 14 insertions, 9 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2d6c3a4..7ef204d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -44,13 +44,13 @@ test_dict_SOURCES = test_dict.c ../common/dict.h ../common/dict.c
test_set_SOURCES = test_set.c ../common/set.h
test_set_LDADD = ../common/libdict.a
-test_tio_SOURCES = test_tio.c ../common/tio.h ../common/tio.c
+test_tio_SOURCES = test_tio.c common.h ../common/tio.h ../common/tio.c
test_tio_LDFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-test_expr_SOURCES = test_expr.c
+test_expr_SOURCES = test_expr.c common.h
test_expr_LDADD = ../common/set.o ../common/dict.o
-test_getpeercred_SOURCES = test_getpeercred.c
+test_getpeercred_SOURCES = test_getpeercred.c common.h
test_getpeercred_LDADD = ../compat/libcompat.a
# common objects that are included for the tests of nslcd functionality
@@ -64,11 +64,11 @@ common_nslcd_LDADD = ../nslcd/log.o ../nslcd/common.o \
../common/libdict.a ../common/libexpr.a \
../compat/libcompat.a
-test_cfg_SOURCES = test_cfg.c
+test_cfg_SOURCES = test_cfg.c common.h
test_cfg_LDADD = $(common_nslcd_LDADD)
-test_myldap_SOURCES = test_myldap.c
+test_myldap_SOURCES = test_myldap.c common.h
test_myldap_LDADD = ../nslcd/cfg.o $(common_nslcd_LDADD)
-test_common_SOURCES = test_common.c
+test_common_SOURCES = test_common.c ../nslcd/common.h
test_common_LDADD = ../nslcd/cfg.o $(common_nslcd_LDADD)
diff --git a/tests/test_nsscmds.sh b/tests/test_nsscmds.sh
index 13dd30c..33efae6 100755
--- a/tests/test_nsscmds.sh
+++ b/tests/test_nsscmds.sh
@@ -26,11 +26,13 @@
set -e
+# find source directory
+srcdir="${srcdir-"."}"
+
# ensure that we are running in the test environment
-. ./in_testenv.sh
+. "$srcdir/in_testenv.sh"
# preload our own NSS module
-srcdir="${srcdir-"."}"
LD_PRELOAD="$srcdir/../nss/nss_ldap.so"
export LD_PRELOAD
diff --git a/tests/test_pamcmds.sh b/tests/test_pamcmds.sh
index 8895540..cb8bf21 100755
--- a/tests/test_pamcmds.sh
+++ b/tests/test_pamcmds.sh
@@ -21,8 +21,11 @@
set -e
+# find source directory
+srcdir="${srcdir-"."}"
+
# ensure that we are running in the test environment
-. ./in_testenv.sh
+. "$srcdir/in_testenv.sh"
# check if we have expect installed
EXPECT="$(which expect 2> /dev/null || true)"