[gegl-gtk] Tests: Disable UI tests when no display server is available



commit 8df0325dfac55c8b6a5fc22d2c50724de460f173
Author: Jon Nordby <jononor gmail com>
Date:   Mon Jul 25 10:57:25 2011 +0200

    Tests: Disable UI tests when no display server is available

 tests/test-view.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/tests/test-view.c b/tests/test-view.c
index a51aca4..11d3f4f 100644
--- a/tests/test-view.c
+++ b/tests/test-view.c
@@ -4,6 +4,11 @@
 #include <gegl-gtk-view.h>
 #include <gegl.h>
 
+gboolean
+test_utils_display_is_set () {
+  return g_getenv ("DISPLAY");
+}
+
 void
 test_utils_print_rect (GeglRectangle *rect) {
 
@@ -131,6 +136,12 @@ main (int argc, char **argv) {
 
     int retval = -1;
 
+    /* Currently all tests depend on having a display server */
+    if (!test_utils_display_is_set()) {
+        g_printf("%s", "Warning: Skipping tests due to missing display server.\n");
+        exit(0);
+    }
+
     g_thread_init(NULL);
     gtk_init(&argc, &argv);
     gegl_init(&argc, &argv);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]