2008-11-18 Emmanuele Bassi <ebassi@linux.intel.com>
authorEmmanuele Bassi <ebassi@openedhand.com>
Tue, 18 Nov 2008 13:06:02 +0000 (13:06 +0000)
committerEmmanuele Bassi <ebassi@openedhand.com>
Tue, 18 Nov 2008 13:06:02 +0000 (13:06 +0000)
* tests/conform/test-conform-main.c (main): Do not run the
conformance test suite if we are on X11 but we do not have
a DISPLAY available. Some of the tests require a DISPLAY,
and everything passes through a clutter_init() call which will
fail anyway. If we are running make distcheck on an headless
box we might as well just skip the conformance test suite
without a meaningless error.

ChangeLog
tests/conform/test-conform-main.c

index 648bfdc..75936be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2008-11-18  Emmanuele Bassi  <ebassi@linux.intel.com>
 
+       * tests/conform/test-conform-main.c (main): Do not run the
+       conformance test suite if we are on X11 but we do not have
+       a DISPLAY available. Some of the tests require a DISPLAY,
+       and everything passes through a clutter_init() call which will
+       fail anyway. If we are running make distcheck on an headless
+       box we might as well just skip the conformance test suite
+       without a meaningless error.
+
+2008-11-18  Emmanuele Bassi  <ebassi@linux.intel.com>
+
        * tests/conform/test-mesh-contiguous.c:
        * tests/conform/test-mesh-interleved.c:
        * tests/conform/test-mesh-mutability.c: Remove the last bare
index 19e7d65..b70ab1c 100644 (file)
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <clutter/clutter.h>
 
 #include <glib.h>
@@ -30,6 +32,18 @@ int
 main (int argc, char **argv)
 {
   TestConformSharedState *shared_state = g_new0 (TestConformSharedState, 1);
+  const gchar *display;
+
+#ifdef HAVE_CLUTTER_GLX
+  /* on X11 we need a display connection to run the test suite */
+  display = g_getenv ("DISPLAY");
+  if (!display || *display == '\0')
+    {
+      g_print ("No DISPLAY found. Unable to run the conformance "
+               "test suite without a display.");
+      return EXIT_SUCCESS;
+    }
+#endif
 
   g_test_init (&argc, &argv, NULL);