summaryrefslogtreecommitdiff
path: root/test_xgps_deps.py
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2018-09-27 15:55:45 -0700
committerFred Wright <fw@fwright.net>2018-09-27 15:58:15 -0700
commit661f9ab1f56c8c365018e06e48bb3126809e89c7 (patch)
tree6e5235e91f5c5e7fbb40cce74e1b506ba4ba72b2 /test_xgps_deps.py
parent8364908d0a3b922643c2f64bfeed3a26ed3a9552 (diff)
downloadgpsd-661f9ab1f56c8c365018e06e48bb3126809e89c7.tar.gz
Adds test for xgps dependencies.
This adds a new test_xgps_deps.py, which duplicates the imports needed by xgps and xgpsspeed, as a quick way to verify that the proper prerequisites are in place. It avoids the imports that require (and connect to) an available X11 server. TESTED: Ran successfully with proper dependencies, and verified failure with either cairo or gobject3 removed.
Diffstat (limited to 'test_xgps_deps.py')
-rwxr-xr-xtest_xgps_deps.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test_xgps_deps.py b/test_xgps_deps.py
new file mode 100755
index 00000000..d6138328
--- /dev/null
+++ b/test_xgps_deps.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+from __future__ import print_function
+
+import sys
+
+import cairo
+
+import gi
+try:
+ gi.require_version('Gtk', '3.0')
+except (AttributeError, ValueError):
+ # Explain the reason for the exception, then reraise
+ print('*** Need PyGObject V3 or later, and Gtk3 ***', file=sys.stderr)
+ raise
+from gi.repository import GObject # pylint: disable=wrong-import-position
+# Skip the imports that require X11
+### from gi.repository import Gtk # pylint: disable=wrong-import-position
+### from gi.repository import Gdk # pylint: disable=wrong-import-position
+### from gi.repository import Pango # pylint: disable=wrong-import-position