summaryrefslogtreecommitdiff
path: root/testsuite/driver
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2013-01-24 14:18:56 -0800
committerDavid Terei <davidterei@gmail.com>2013-01-24 14:19:51 -0800
commit8e9572b6396620466e5da17b65b4c1a793e5ee04 (patch)
tree0df20361fca7bd633e068491b7f974bd3dd9ce7a /testsuite/driver
parent3e70ca7a0865f5cf2e7c3134803a4645423da791 (diff)
downloadhaskell-8e9572b6396620466e5da17b65b4c1a793e5ee04.tar.gz
fix runtests to set LD_LIBRARY_PATH environment variable.
Patch from Karel Gardas <karel.gardas@centrum.cz>.
Diffstat (limited to 'testsuite/driver')
-rw-r--r--testsuite/driver/runtests.py48
1 files changed, 26 insertions, 22 deletions
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index 66e3bf4d5e..d2b5c7849f 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -181,28 +181,32 @@ from testlib import *
# On Windows we need to set $PATH to include the paths to all the DLLs
# in order for the dynamic library tests to work.
-if windows or darwin:
- pkginfo = getStdout([config.ghc_pkg, 'dump'])
- topdir = config.libdir
- for line in pkginfo.split('\n'):
- if line.startswith('library-dirs:'):
- path = line.rstrip()
- path = re.sub('^library-dirs: ', '', path)
- path = re.sub('\\$topdir', topdir, path)
- if path.startswith('"'):
- path = re.sub('^"(.*)"$', '\\1', path)
- path = re.sub('\\\\(.)', '\\1', path)
- if windows:
- if config.cygwin:
- # On cygwin we can't put "c:\foo" in $PATH, as : is a
- # field separator. So convert to /cygdrive/c/foo instead.
- # Other pythons use ; as the separator, so no problem.
- path = re.sub('([a-zA-Z]):', '/cygdrive/\\1', path)
- path = re.sub('\\\\', '/', path)
- os.environ['PATH'] = os.pathsep.join([path, os.environ.get("PATH", "")])
- else:
- # darwin
- os.environ['DYLD_LIBRARY_PATH'] = os.pathsep.join([path, os.environ.get("DYLD_LIBRARY_PATH", "")])
+# if windows or darwin:
+pkginfo = getStdout([config.ghc_pkg, 'dump'])
+topdir = config.libdir
+for line in pkginfo.split('\n'):
+ if line.startswith('library-dirs:'):
+ path = line.rstrip()
+ path = re.sub('^library-dirs: ', '', path)
+ path = re.sub('\\$topdir', topdir, path)
+ if path.startswith('"'):
+ path = re.sub('^"(.*)"$', '\\1', path)
+ path = re.sub('\\\\(.)', '\\1', path)
+ if windows:
+ if config.cygwin:
+ # On cygwin we can't put "c:\foo" in $PATH, as : is a
+ # field separator. So convert to /cygdrive/c/foo instead.
+ # Other pythons use ; as the separator, so no problem.
+ path = re.sub('([a-zA-Z]):', '/cygdrive/\\1', path)
+ path = re.sub('\\\\', '/', path)
+ os.environ['PATH'] = os.pathsep.join([path, os.environ.get("PATH", "")])
+ elif darwin:
+ # darwin
+ os.environ['DYLD_LIBRARY_PATH'] = os.pathsep.join([path, os.environ.get("DYLD_LIBRARY_PATH", "")])
+ else:
+ # unix
+ os.environ['LD_LIBRARY_PATH'] = os.pathsep.join([path, os.environ.get("LD_LIBRARY_PATH", "")])
+
global testopts_local
testopts_local.x = TestOptions()