From 9bb133990a82899f9d8614489b88af51f9161a23 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 23 Jan 2015 12:12:36 -0600 Subject: [PATCH] tests: Skip buffer count test if wl_drm isn't present This skips the test when running on the headless backend. Signed-off-by: Derek Foreman Reviewed-by: Bryce Harrington (Presumably) Reviewed-by: Daniel Stone --- 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 +#include #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.7.4