[PATCH v2 weston] tests: Skip buffer count test if wl_drm isn't present

Derek Foreman derekf at osg.samsung.com
Fri Jan 23 10:12:36 PST 2015


This skips the test when running on the headless backend.

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 tests/buffer-count-test.c         | 3 +++
 tests/weston-test-client-helper.c | 2 ++
 tests/weston-test-client-helper.h | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/tests/buffer-count-test.c b/tests/buffer-count-test.c
index 5985a9e..43fb089 100644
--- a/tests/buffer-count-test.c
+++ b/tests/buffer-count-test.c
@@ -123,6 +123,9 @@ TEST(test_buffer_count)
 	int i;
 
 	test_data.client = client_create(10, 10, 10, 10);
+	if (!test_data.client->has_wl_drm)
+		skip("compositor has not bound its display to EGL\n");
+
 	if (init_egl(&test_data) < 0)
 		skip("could not initialize egl, "
 		     "possibly using the headless backend\n");
diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c
index e21439c..518e899 100644
--- a/tests/weston-test-client-helper.c
+++ b/tests/weston-test-client-helper.c
@@ -482,6 +482,8 @@ handle_global(void *data, struct wl_registry *registry,
 					 &wl_test_interface, 1);
 		wl_test_add_listener(test->wl_test, &test_listener, test);
 		client->test = test;
+	} else if (strcmp(interface, "wl_drm") == 0) {
+		client->has_wl_drm = true;
 	}
 }
 
diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h
index 2cf3d8f..a6ea524 100644
--- a/tests/weston-test-client-helper.h
+++ b/tests/weston-test-client-helper.h
@@ -26,6 +26,7 @@
 #include "config.h"
 
 #include <assert.h>
+#include <stdbool.h>
 #include "weston-test-runner.h"
 #include "wayland-test-client-protocol.h"
 
@@ -40,6 +41,7 @@ struct client {
 	struct surface *surface;
 	int has_argb;
 	struct wl_list global_list;
+	bool has_wl_drm;
 };
 
 struct global {
-- 
2.1.4



More information about the wayland-devel mailing list