summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2014-03-10 22:51:32 +0100
committerArthur de Jong <arthur@arthurdejong.org>2014-03-10 23:00:40 +0100
commit44764f0fbf898c556ca599658029551036ad5481 (patch)
tree141b7c7f03ac01dd7150678db414f1fb7e2b2d18 /tests
parent77444ac1328b4538a6e21d2af4c07a69e52e903d (diff)
Run the correct executables for the tests
This fixes issues with running the tests when using a separate build directory (fixes ef0eddaa).
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am5
-rwxr-xr-xtests/test_myldap.sh5
-rwxr-xr-xtests/test_nsscmds.sh8
3 files changed, 11 insertions, 7 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 506dbef..862b510 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,7 @@
# Makefile.am - use automake to generate Makefile.in
#
# Copyright (C) 2006 West Consulting
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arthur de Jong
+# Copyright (C) 2006-2014 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -28,7 +28,8 @@ if ENABLE_PYNSLCD
TESTS += test_pynslcd_cache.py
endif
-AM_TESTS_ENVIRONMENT = PYTHON='@PYTHON@'; export PYTHON;
+AM_TESTS_ENVIRONMENT = PYTHON='@PYTHON@'; export PYTHON; \
+ builddir=$(builddir); export builddir;
check_PROGRAMS = test_dict test_set test_tio test_expr test_getpeercred \
test_cfg test_myldap test_common test_clock test_tio_timeout \
diff --git a/tests/test_myldap.sh b/tests/test_myldap.sh
index fa94eac..58820ce 100755
--- a/tests/test_myldap.sh
+++ b/tests/test_myldap.sh
@@ -2,7 +2,7 @@
# test_myldap.sh - simple wrapper test script for test_myldap
#
-# Copyright (C) 2007 Arthur de Jong
+# Copyright (C) 2007-2014 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -27,6 +27,7 @@ set -e
# get LDAP config
srcdir="${srcdir-`dirname "$0"`}"
+builddir="${builddir-`dirname "$0"`}"
cfgfile="$srcdir/nslcd-test.conf"
uri=`sed -n 's/^uri *//p' "$cfgfile" | head -n 1`
base="dc=test,dc=tld"
@@ -39,4 +40,4 @@ chmod o-rwx "$cfgfile"
# just execute test_myldap
export srcdir
-exec "$srcdir/test_myldap"
+exec "$builddir/test_myldap"
diff --git a/tests/test_nsscmds.sh b/tests/test_nsscmds.sh
index 2c5ffc6..a86d9d8 100755
--- a/tests/test_nsscmds.sh
+++ b/tests/test_nsscmds.sh
@@ -2,7 +2,7 @@
# test_nsscmds.sh - simple test script to check output of name lookup commands
#
-# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arthur de Jong
+# Copyright (C) 2007-2014 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -28,14 +28,16 @@ set -e
# find source directory
srcdir="${srcdir-`dirname "$0"`}"
+builddir="${builddir-`dirname "$0"`}"
+top_builddir="${top_builddir-${builddir}/..}"
# ensure that we are running in the test environment
"$srcdir/testenv.sh" check || exit 77
# preload our own NSS module
-if [ -e "$srcdir/../nss/nss_ldap.so" ]
+if [ -e "$top_builddir/nss/nss_ldap.so" ]
then
- LD_PRELOAD="$srcdir/../nss/nss_ldap.so"
+ LD_PRELOAD="$top_builddir/nss/nss_ldap.so"
export LD_PRELOAD
fi