Skip to content

Commit 9d50dab

Browse files
committed
Use the correct shared library name on Mac
1 parent f4018df commit 9d50dab

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/runner.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'''
1515

1616
from subprocess import Popen, PIPE, STDOUT
17-
import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, tempfile, re, difflib, webbrowser, hashlib, BaseHTTPServer, threading
17+
import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, tempfile, re, difflib, webbrowser, hashlib, BaseHTTPServer, threading, platform
1818

1919
# Setup
2020

@@ -67,6 +67,15 @@ def skip(self, why):
6767
def get_dir(self):
6868
return self.working_dir
6969

70+
def get_shared_library_name(self, linux_name):
71+
if platform.system() == 'Linux':
72+
return linux_name
73+
elif platform.system() == 'Darwin':
74+
return linux_name.replace('.so', '') + '.dylib'
75+
else:
76+
print >> sys.stderr, 'get_shared_library_name needs to be implemented on %s' % platform.system()
77+
return linux_name
78+
7079
def get_stdout_path(self):
7180
return os.path.join(self.get_dir(), 'stdout')
7281

@@ -4336,7 +4345,7 @@ def process(filename):
43364345
shutil.copy(path_from_root('tests', 'openjpeg', 'opj_config.h'), self.get_dir())
43374346

43384347
lib = self.get_library('openjpeg',
4339-
[os.path.join('bin', 'libopenjpeg.so.1.4.0'),
4348+
[os.path.join('bin', self.get_shared_library_name('libopenjpeg.so.1.4.0')),
43404349
os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/index.c.o'.split('/')),
43414350
os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/convert.c.o'.split('/')),
43424351
os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/__/common/color.c.o'.split('/')),

0 commit comments

Comments
 (0)