summaryrefslogtreecommitdiff
path: root/regress-driver
diff options
context:
space:
mode:
authorBernd Zeimetz <bernd@bzed.de>2010-04-16 01:41:29 +0200
committerBernd Zeimetz <bernd@bzed.de>2010-04-16 01:41:29 +0200
commit8dd5eaee9e662f7baccb05c57cb3748a95fd7cd8 (patch)
tree064a8f812f644f2182b0c8c3dbbd443de4914ffd /regress-driver
parentd42b7950fed05c35be224ffee6d10eac523663d2 (diff)
downloadgpsd-8dd5eaee9e662f7baccb05c57cb3748a95fd7cd8.tar.gz
regress-driver: Use setup.py build directory.
To ensure that regress-driver doesn't use a system-wide installation of the gps module and scripts, the scripts and lib directory from the setup.py build are added to PYTHONPATH/PATH.
Diffstat (limited to 'regress-driver')
-rwxr-xr-xregress-driver22
1 files changed, 20 insertions, 2 deletions
diff --git a/regress-driver b/regress-driver
index c881ee7b..1f4829e0 100755
--- a/regress-driver
+++ b/regress-driver
@@ -3,8 +3,26 @@
# The regression-test driver script. This used to be explicit in the
# makefile before we regrouped the regression tests by stable and unstable
# drivers.
-#
-PATH=.:$PATH
+
+# Add the current directory to $PATH
+PATH=`pwd`:$PATH
+
+# Use built Python files if available - instead of using
+# those which were installed somewhere in the system.
+if [ -d build ]; then
+ if [ -z ${PYTHON} ]; then
+ PYTHON="python"
+ fi
+ libdir=`pwd`/build/`${PYTHON} -c 'import distutils.util; import sys; print "lib.%s-%s" %(distutils.util.get_platform(), sys.version[0:3])'`
+ scriptdir=`pwd`/build/`${PYTHON} -c 'import sys; print "scripts-%s" %(sys.version[0:3], )'`
+ if [ -d ${libdir} ] && [ -d ${scriptdir} ]; then
+ PYTHONPATH=${libdir}
+ export PYTHONPATH
+
+ PATH=${scriptdir}:${PATH}
+ fi
+fi
+
export PATH
mode=regress