From 36aea747c47f1fbbe2311e0111707131708c52e2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Jun 2016 23:29:03 +0530 Subject: [PATCH] Nope libusb still fails to initialize So only check that the DLL can be loaded --- .travis.yml | 5 ----- src/calibre/test_build.py | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index de60cf3127..5c53cd8459 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,6 @@ language: generic env: - SW=$HOME/sw PATH=$SW/bin:$PATH CFLAGS=-I$SW/include LDFLAGS=-L$SW/lib LD_LIBRARY_PATH=$SW/qt/lib:$SW/lib PKG_CONFIG_PATH=$SW/lib/pkgconfig QMAKE=$SW/qt/bin/qmake QT_PLUGIN_PATH=$SW/qt/plugins -addons: - apt: - packages: - - libudev-dev - before_install: - curl https://download.calibre-ebook.com/travis/sw-linux.tar.xz | tar xJ -C $HOME - python setup.py bootstrap --ephemeral diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py index 674375c8bf..a08ef19f07 100644 --- a/src/calibre/test_build.py +++ b/src/calibre/test_build.py @@ -14,6 +14,7 @@ Test a binary calibre build to ensure that all needed binary images/libraries ha import os, ctypes, sys, unittest from calibre.constants import plugins, iswindows, islinux, isosx +is_travis = os.environ.get('TRAVIS') == 'true' class BuildTest(unittest.TestCase): @@ -59,6 +60,11 @@ class BuildTest(unittest.TestCase): def test_plugins(self): 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'))) + continue mod, err = plugins[name] self.assertFalse(err or not mod, 'Failed to load plugin: ' + name + ' with error:\n' + err)