diff options
author | Adam Jackson <ajax@redhat.com> | 2018-04-25 12:13:01 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2018-04-30 14:12:43 -0400 |
commit | 43ac91170d61514ab1dd156a4373664b961d81d3 (patch) | |
tree | d44a974fe316a1f14770913be43198a82ec5330d | |
parent | 610203a1a4ce5709191a08572709e6a691e6b928 (diff) | |
download | libepoxy-43ac91170d61514ab1dd156a4373664b961d81d3.tar.gz |
test/glx_public_api_core: Fail softer if core contexts aren't available
If you've built Mesa with --disable-texture-float, and try to run the
tests against Xvfb, glx_public_api_core will fail: creating a direct
context with llvmpipe will fail because you don't have
ARB_texture_float, and the internal fallback to an indirect context will
fail because indirect only supports through 1.4. So the server will
throw GLXBadFBConfig at you to say "I don't support core contexts",
which we should interpret as a skip not a failure.
Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r-- | test/glx_public_api_core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/glx_public_api_core.c b/test/glx_public_api_core.c index 83b9689..f5a4f04 100644 --- a/test/glx_public_api_core.c +++ b/test/glx_public_api_core.c @@ -131,6 +131,12 @@ test_glx_version(void) return true; } +static int +error_handler(Display *d, XErrorEvent *ev) +{ + return 0; +} + int main(int argc, char **argv) { @@ -148,6 +154,7 @@ main(int argc, char **argv) None }; GLXContext ctx; + int (*old_handler)(Display *, XErrorEvent *); dpy = get_display_or_skip(); @@ -157,9 +164,12 @@ main(int argc, char **argv) visinfo = get_glx_visual(dpy); win = get_glx_window(dpy, visinfo, false); config = get_fbconfig_for_visinfo(dpy, visinfo); + + old_handler = XSetErrorHandler(error_handler); ctx = glXCreateContextAttribsARB(dpy, config, NULL, True, attribs); if (ctx == None) errx(77, "glXCreateContext failed"); + XSetErrorHandler(old_handler); glXMakeCurrent(dpy, win, ctx); |