summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2012-04-09 20:59:43 -0700
committerChad Versace <chad.versace@linux.intel.com>2012-04-10 19:18:37 -0700
commitd9ade40447eabf0c6e05f6739e5de74a2636eb81 (patch)
treebd12a7f0d6cfeaceadffc0f09e28e2fea1719d76
parentfc147e2825f97697ee8a5a3e0ac2911855a847d0 (diff)
tests/functional: Check that EGL_PLATFORM env var is set
If Mesa's libEGL is built with support for multiple platforms, then the environment variable EGL_PLATFORM must be set before the first EGL call. Otherwise, libEGL may initialize itself with the incorrect platform. In my experiments, first calling eglGetProcAddress will produce a segfault in eglInitialize. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r--tests/functional/gl_basic_test.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c
index 46696ad..173a414 100644
--- a/tests/functional/gl_basic_test.c
+++ b/tests/functional/gl_basic_test.c
@@ -144,6 +144,15 @@ gl_basic(int32_t platform, int32_t gl_api)
ASSERT_TRUE(waffle_init(init_attrib_list));
+ // Check that we've set the EGL_PLATFORM environment variable for Mesa.
+ //
+ // If Mesa's libEGL is built with support for multiple platforms, then the
+ // environment variable EGL_PLATFORM must be set before the first EGL
+ // call. Otherwise, libEGL may initialize itself with the incorrect
+ // platform. In my experiments, first calling eglGetProcAddress will
+ // produce a segfault in eglInitialize.
+ waffle_get_proc_address("glClear");
+
// Create objects.
ASSERT_TRUE(dpy = waffle_display_connect(NULL));
ASSERT_TRUE(config = waffle_config_choose(dpy, config_attrib_list));
@@ -225,4 +234,4 @@ int
main(int argc, char *argv[])
{
return wt_main(&argc, argv, test_suites);
-} \ No newline at end of file
+}