aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-30 21:21:19 -0500
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-30 21:21:19 -0500
commit9d50dabd93d499f8f059990668c2318d60c5dc1c (patch)
tree6c7b9146851c502e0b12ce68570bc00f4b60f5c0
parentf4018dfb9741d111a5358e918e445c5b1b10a370 (diff)
Use the correct shared library name on Mac
-rwxr-xr-xtests/runner.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 61c98e6b..b58c948b 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -14,7 +14,7 @@ will use 4 processes. To install nose do something like
'''
from subprocess import Popen, PIPE, STDOUT
-import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, tempfile, re, difflib, webbrowser, hashlib, BaseHTTPServer, threading
+import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, tempfile, re, difflib, webbrowser, hashlib, BaseHTTPServer, threading, platform
# Setup
@@ -67,6 +67,15 @@ class RunnerCore(unittest.TestCase):
def get_dir(self):
return self.working_dir
+ def get_shared_library_name(self, linux_name):
+ if platform.system() == 'Linux':
+ return linux_name
+ elif platform.system() == 'Darwin':
+ return linux_name.replace('.so', '') + '.dylib'
+ else:
+ print >> sys.stderr, 'get_shared_library_name needs to be implemented on %s' % platform.system()
+ return linux_name
+
def get_stdout_path(self):
return os.path.join(self.get_dir(), 'stdout')
@@ -4336,7 +4345,7 @@ def process(filename):
shutil.copy(path_from_root('tests', 'openjpeg', 'opj_config.h'), self.get_dir())
lib = self.get_library('openjpeg',
- [os.path.join('bin', 'libopenjpeg.so.1.4.0'),
+ [os.path.join('bin', self.get_shared_library_name('libopenjpeg.so.1.4.0')),
os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/index.c.o'.split('/')),
os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/convert.c.o'.split('/')),
os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/__/common/color.c.o'.split('/')),