[waffle] [PATCH 28/29] tests/gl_basic: add support for GBM platform

Emil Velikov emil.l.velikov at gmail.com
Wed Jan 6 13:27:54 PST 2016


From: Emil Velikov <emil.velikov at collabora.com>

This way we can also run waffle's tests through headless CI ;-)

Fixes #34: https://github.com/waffle-gl/waffle/issues/34
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 tests/functional/gl_basic_test.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c
index 4e81ece..10a7af8 100644
--- a/tests/functional/gl_basic_test.c
+++ b/tests/functional/gl_basic_test.c
@@ -614,7 +614,8 @@ test_glesXX(3, 30, NO_ERROR)
 // we have to split the ESx + fwdcompat tests into "CGL and everyone else".
 //
 
-#if defined(WAFFLE_HAS_GLX) || \
+#if defined(WAFFLE_HAS_GBM) || \
+    defined(WAFFLE_HAS_GLX) || \
     defined(WAFFLE_HAS_WAYLAND) || \
     defined(WAFFLE_HAS_X11_EGL) || \
     defined(WAFFLE_HAS_WGL)
@@ -642,6 +643,17 @@ CREATE_TESTSUITE(WAFFLE_PLATFORM_CGL, cgl)
 
 #endif // WAFFLE_HAS_CGL
 
+#ifdef WAFFLE_HAS_GBM
+
+#define unit_test_make(name)                                            \
+    cmocka_unit_test_setup_teardown(name, setup_gbm, gl_basic_fini)
+
+CREATE_TESTSUITE(WAFFLE_PLATFORM_GBM, gbm)
+
+#undef unit_test_make
+
+#endif // WAFFLE_HAS_GBM
+
 #ifdef WAFFLE_HAS_GLX
 
 #define unit_test_make(name)                                            \
@@ -708,7 +720,7 @@ static const char *usage_message =
     "\n"
     "Required Parameter:\n"
     "    -p, --platform\n"
-    "        One of: cgl, glx, wayland, wgl or x11_egl\n"
+    "        One of: cgl, gbm, glx, wayland, wgl or x11_egl\n"
     "\n"
     "Options:\n"
     "    -h, --help\n"
@@ -764,6 +776,7 @@ struct enum_map {
 
 static const struct enum_map platform_map[] = {
     {WAFFLE_PLATFORM_CGL,       "cgl",          },
+    {WAFFLE_PLATFORM_GBM,       "gbm"           },
     {WAFFLE_PLATFORM_GLX,       "glx"           },
     {WAFFLE_PLATFORM_WAYLAND,   "wayland"       },
     {WAFFLE_PLATFORM_WGL,       "wgl"           },
@@ -864,6 +877,10 @@ main(int argc, char *argv[])
     case WAFFLE_PLATFORM_CGL:
         return testsuite_cgl();
 #endif
+#ifdef WAFFLE_HAS_GBM
+    case WAFFLE_PLATFORM_GBM:
+        return testsuite_gbm();
+#endif
 #ifdef WAFFLE_HAS_GLX
     case WAFFLE_PLATFORM_GLX:
         return testsuite_glx();
-- 
2.6.2



More information about the waffle mailing list