mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Merge branch 'speechtest' of https://github.com/eli-schwartz/calibre
This commit is contained in:
commit
02e7bc75a6
@ -123,6 +123,7 @@ class BuildTest(unittest.TestCase):
|
|||||||
from speechd.client import SSIPClient
|
from speechd.client import SSIPClient
|
||||||
del SSIPClient
|
del SSIPClient
|
||||||
|
|
||||||
|
@unittest.skipIf('SKIP_SPEECH_TESTS' in os.environ, 'Speech support is opted out')
|
||||||
def test_piper(self):
|
def test_piper(self):
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
@ -322,7 +323,7 @@ class BuildTest(unittest.TestCase):
|
|||||||
def test_qt(self):
|
def test_qt(self):
|
||||||
if is_sanitized:
|
if is_sanitized:
|
||||||
raise unittest.SkipTest('Skipping Qt build test as sanitizer is enabled')
|
raise unittest.SkipTest('Skipping Qt build test as sanitizer is enabled')
|
||||||
from qt.core import QApplication, QFontDatabase, QImageReader, QLoggingCategory, QMediaDevices, QNetworkAccessManager, QSslSocket, QTextToSpeech, QTimer
|
from qt.core import QApplication, QFontDatabase, QImageReader, QLoggingCategory, QNetworkAccessManager, QSslSocket, QTimer
|
||||||
QLoggingCategory.setFilterRules('''qt.webenginecontext.debug=true''')
|
QLoggingCategory.setFilterRules('''qt.webenginecontext.debug=true''')
|
||||||
if hasattr(os, 'geteuid') and os.geteuid() == 0:
|
if hasattr(os, 'geteuid') and os.geteuid() == 0:
|
||||||
# likely a container build, webengine cannot run as root with sandbox
|
# likely a container build, webengine cannot run as root with sandbox
|
||||||
@ -356,12 +357,15 @@ class BuildTest(unittest.TestCase):
|
|||||||
try:
|
try:
|
||||||
ensure_app()
|
ensure_app()
|
||||||
self.assertGreaterEqual(len(QFontDatabase.families()), 5, 'The QPA headless plugin is not able to locate enough system fonts via fontconfig')
|
self.assertGreaterEqual(len(QFontDatabase.families()), 5, 'The QPA headless plugin is not able to locate enough system fonts via fontconfig')
|
||||||
available_tts_engines = tuple(x for x in QTextToSpeech.availableEngines() if x != 'mock')
|
|
||||||
self.assertTrue(available_tts_engines)
|
|
||||||
|
|
||||||
QMediaDevices.audioOutputs()
|
if 'SKIP_SPEECH_TESTS' not in os.environ:
|
||||||
|
from qt.core import QMediaDevices, QTextToSpeech
|
||||||
|
|
||||||
|
available_tts_engines = tuple(x for x in QTextToSpeech.availableEngines() if x != 'mock')
|
||||||
|
self.assertTrue(available_tts_engines)
|
||||||
|
|
||||||
|
QMediaDevices.audioOutputs()
|
||||||
|
|
||||||
self.assertGreaterEqual
|
|
||||||
from calibre.ebooks.oeb.transforms.rasterize import rasterize_svg
|
from calibre.ebooks.oeb.transforms.rasterize import rasterize_svg
|
||||||
img = rasterize_svg(as_qimage=True)
|
img = rasterize_svg(as_qimage=True)
|
||||||
self.assertFalse(img.isNull())
|
self.assertFalse(img.isNull())
|
||||||
|
@ -190,6 +190,8 @@ class TestImports(unittest.TestCase):
|
|||||||
'calibre.utils.linux_trash', 'calibre.utils.open_with.linux',
|
'calibre.utils.linux_trash', 'calibre.utils.open_with.linux',
|
||||||
'calibre.gui2.linux_file_dialogs',
|
'calibre.gui2.linux_file_dialogs',
|
||||||
}
|
}
|
||||||
|
if 'SKIP_SPEECH_TESTS' in os.environ:
|
||||||
|
exclude_packages.add('calibre.gui2.tts')
|
||||||
if not isbsd:
|
if not isbsd:
|
||||||
exclude_modules.add('calibre.devices.usbms.hal')
|
exclude_modules.add('calibre.devices.usbms.hal')
|
||||||
d = os.path.dirname
|
d = os.path.dirname
|
||||||
|
Loading…
x
Reference in New Issue
Block a user