mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Aaaah, now I get it :)
This commit is contained in:
parent
9c1498d4ca
commit
d11e8ce62c
@ -2,10 +2,9 @@ sudo: false
|
||||
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
|
||||
- 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
|
||||
|
||||
before_install:
|
||||
- curl https://download.calibre-ebook.com/travis/sw-linux.tar.xz | tar xJ -C $HOME
|
||||
- python -c "from PyQt5.QtCore import QCoreApplication; print(QCoreApplication.libraryPaths())"
|
||||
- python setup.py bootstrap --ephemeral
|
||||
script: python setup.py test
|
||||
|
@ -79,9 +79,6 @@ class Test(Command):
|
||||
|
||||
def run(self, opts):
|
||||
from calibre.utils.run_tests import run_cli, filter_tests_by_name
|
||||
if is_travis:
|
||||
from calibre.gui2 import ensure_app
|
||||
ensure_app()
|
||||
tests = find_tests(which_tests=frozenset(opts.test_module))
|
||||
if opts.test_name:
|
||||
tests = filter_tests_by_name(tests, *opts.test_name)
|
||||
|
@ -103,6 +103,13 @@ class BuildTest(unittest.TestCase):
|
||||
def test_qt(self):
|
||||
from PyQt5.Qt import QImageReader, QNetworkAccessManager, QFontDatabase
|
||||
from calibre.utils.img import image_from_data, image_to_data, test
|
||||
# Ensure that images can be read before QApplication is constructed.
|
||||
# Note that this requires QCoreApplication.libraryPaths() to return the
|
||||
# path to the Qt plugins which it always does in the frozen build,
|
||||
# because the QT_PLUGIN_PATH env var is set. On non-frozen builds,
|
||||
# it should just work because the hard-coded paths of the Qt
|
||||
# installation should work. If they do not, then it is a distro
|
||||
# problem.
|
||||
fmts = set(map(unicode, QImageReader.supportedImageFormats()))
|
||||
testf = {'jpg', 'png', 'svg', 'ico', 'gif'}
|
||||
self.assertEqual(testf.intersection(fmts), testf, "Qt doesn't seem to be able to load some of its image plugins. Available plugins: %s" % fmts)
|
||||
|
Loading…
x
Reference in New Issue
Block a user