From de39f394bf20016bd43c61ef85e68f0b06e09cdd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 16 Nov 2013 21:00:29 +0530 Subject: [PATCH] Add build integrity tests for dbus --- src/calibre/test_build.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py index 5175904427..e06eb5f75e 100644 --- a/src/calibre/test_build.py +++ b/src/calibre/test_build.py @@ -13,7 +13,18 @@ Test a binary calibre build to ensure that all needed binary images/libraries ha ''' import cStringIO -from calibre.constants import plugins, iswindows +from calibre.constants import plugins, iswindows, islinux + +def test_dbus(): + import dbus + bus = dbus.SystemBus() + if not bus.list_names(): + raise ValueError('Failed to list names on the system bus') + bus = dbus.SessionBus() + if not bus.list_names(): + raise ValueError('Failed to list names on the session bus') + del bus + print ('dbus OK!') def test_regex(): import regex @@ -59,7 +70,8 @@ def test_sqlite(): print ('sqlite OK!') def test_qt(): - from PyQt4.Qt import (QWebView, QDialog, QImageReader, QNetworkAccessManager) + from PyQt4.Qt import (QDialog, QImageReader, QNetworkAccessManager) + from PyQt4.QtWebKit import QWebView fmts = set(map(unicode, QImageReader.supportedImageFormats())) testf = set(['jpg', 'png', 'mng', 'svg', 'ico', 'gif']) if testf.intersection(fmts) != testf: @@ -129,6 +141,8 @@ def test(): if iswindows: test_winutil() test_wpd() + if islinux: + test_dbus() if __name__ == '__main__': test()