summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2014-01-01 17:38:04 -0800
committerKristian Høgsberg <krh@bitplanet.net>2014-01-01 17:38:04 -0800
commit42284f5f9e08d68b28d011924983a19f1e070eef (patch)
tree3e23fbe0a9ef9ab8a3152968d9471fa741f7912b /tests
parent4598f965faa30ae659ec8b512134f1cb7dc7e2db (diff)
tests: Only run buffer-count test if we have at least mesa 10
https://bugs.freedesktop.org/show_bug.cgi?id=72835
Diffstat (limited to 'tests')
-rw-r--r--tests/buffer-count-test.c13
-rw-r--r--tests/weston-test-client-helper.c14
-rw-r--r--tests/weston-test-client-helper.h3
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/buffer-count-test.c b/tests/buffer-count-test.c
index ad2bceeb..3b66e317 100644
--- a/tests/buffer-count-test.c
+++ b/tests/buffer-count-test.c
@@ -45,6 +45,7 @@ init_egl(struct test_data *test_data)
{
struct wl_egl_window *native_window;
struct surface *surface = test_data->client->surface;
+ const char *str, *mesa;
static const EGLint context_attribs[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
@@ -95,6 +96,18 @@ init_egl(struct test_data *test_data)
ret = eglMakeCurrent(test_data->egl_dpy, test_data->egl_surface,
test_data->egl_surface, test_data->egl_ctx);
assert(ret == EGL_TRUE);
+
+ /* This test is specific to mesa 10.0 and later, which is the
+ * first release that doesn't accidentally triple-buffer. */
+ str = (const char *) glGetString(GL_VERSION);
+ mesa = strstr(str, "Mesa ");
+ if (mesa == NULL)
+ skip("unknown EGL implementation (%s)\n", str);
+ if (sscanf(mesa + 5, "%d.%d", &major, &minor) != 2)
+ skip("unrecognized mesa version (%s)\n", str);
+ if (major < 10)
+ skip("mesa version too old (%s)\n", str);
+
}
TEST(test_buffer_count)
diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c
index fd265f2e..399aa443 100644
--- a/tests/weston-test-client-helper.c
+++ b/tests/weston-test-client-helper.c
@@ -496,6 +496,20 @@ static const struct wl_registry_listener registry_listener = {
handle_global
};
+void
+skip(const char *fmt, ...)
+{
+ va_list argp;
+
+ va_start(argp, fmt);
+ vfprintf(stderr, fmt, argp);
+ va_end(argp);
+
+ /* automake tests uses exit code 77, but we don't have a good
+ * way to make weston exit with that from here. */
+ exit(0);
+}
+
static void
log_handler(const char *fmt, va_list args)
{
diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h
index c78fc28b..6670ab37 100644
--- a/tests/weston-test-client-helper.h
+++ b/tests/weston-test-client-helper.h
@@ -124,4 +124,7 @@ frame_callback_wait(struct client *client, int *done);
int
get_n_egl_buffers(struct client *client);
+void
+skip(const char *fmt, ...);
+
#endif