diff --git a/src/calibre/srv/tests/loop.py b/src/calibre/srv/tests/loop.py index d11e7678f5..3ed5589160 100644 --- a/src/calibre/srv/tests/loop.py +++ b/src/calibre/srv/tests/loop.py @@ -17,7 +17,7 @@ try: except ImportError: create_server_cert = None - +from calibre.constants import isosx from calibre.srv.pre_activated import has_preactivated_support from calibre.srv.tests.base import BaseTest, TestServer from calibre.ptempfile import TemporaryDirectory @@ -187,6 +187,8 @@ class LoopTest(BaseTest): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) s.bind(('localhost', 0)) address = s.getsockname()[0] + if is_travis and isosx: + address = '::1' with TemporaryDirectory('srv-test-ssl') as tdir: cert_file, key_file, ca_file = map(lambda x:os.path.join(tdir, x), 'cka') create_server_cert(address, ca_file, cert_file, key_file, key_size=1024) diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py index a08ef19f07..1474f926e6 100644 --- a/src/calibre/test_build.py +++ b/src/calibre/test_build.py @@ -59,11 +59,24 @@ class BuildTest(unittest.TestCase): test_dictionaries() def test_plugins(self): + exclusions = set() + if is_travis: + if isosx: + # The compiler version on OS X is different between the + # machine on which the dependencies are built and the + # machine on which the calibre modules are built, which causes + # C++ name mangling incompatibilities preventing some modules + # from loading + exclusions.update(set('podofo'.split())) + else: + # libusb fails to initialize in the travis container + exclusions.update(set('libusb libmtp'.split())) for name in plugins: - if (is_travis and name in ('libusb', 'libmtp')): - # libusb fails to initialize on travis, so just check that the - # DLL can be loaded - ctypes.CDLL(os.path.join(sys.extensions_location, name + ('.dylib' if isosx else '.so'))) + if name in exclusions: + if not isosx: + # libusb fails to initialize on travis, so just check that the + # DLL can be loaded + ctypes.CDLL(os.path.join(sys.extensions_location, name + ('.dylib' if isosx else '.so'))) continue mod, err = plugins[name] self.assertFalse(err or not mod, 'Failed to load plugin: ' + name + ' with error:\n' + err) @@ -191,6 +204,7 @@ class BuildTest(unittest.TestCase): import psutil psutil.Process(os.getpid()) + @unittest.skipIf(is_travis and isosx, 'Currently there is a C++ ABI incompatibility until the osx-build machine is moved to OS X 10.9') def test_podofo(self): from calibre.utils.podofo import test_podofo as dotest dotest()