summaryrefslogtreecommitdiff
path: root/tests/spec/glx_oml_sync_control
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2014-04-18 12:04:47 -0700
committerEric Anholt <eric@anholt.net>2014-10-10 17:27:00 +0200
commit1ea4e712649573bf226950b4ee7b2c77b2e27042 (patch)
treef8c7b14639f97349bfda0a3ca2b3445ac60f3b4f /tests/spec/glx_oml_sync_control
parenta5d33065cb99562f60cf46436a950bf08c73d0af (diff)
Only test non-default swap_interval if supported.
If this test is compiled on a machine that does not have headers for GLX_MESA_swap_control, then it should skip any tests that require using GLX_MESA_swap_control. I tested this patch in both configurations, using "#if 0 && ..." to check the unsupported-at-build-time case. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'tests/spec/glx_oml_sync_control')
-rw-r--r--tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
index 246f6d4da..6041a1061 100644
--- a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
+++ b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
@@ -51,8 +51,8 @@ draw(Display *dpy)
bool pass = true;
int i;
-#if defined(GLX_MESA_swap_control)
if (swap_interval != -1) {
+#if defined(GLX_MESA_swap_control)
PFNGLXSWAPINTERVALMESAPROC pglXSwapIntervalMESA;
printf("Testing with swap interval %d\n", swap_interval);
@@ -62,12 +62,15 @@ draw(Display *dpy)
glXGetProcAddressARB((const GLubyte *)
"glXSwapIntervalMESA");
pglXSwapIntervalMESA(swap_interval);
+#else
+ fprintf(stderr,
+ "Testing swap interval %d requires building with GLX_MESA_swap_control\n",
+ swap_interval);
+ piglit_report_result(PIGLIT_SKIP);
+#endif
} else {
printf("Testing with default swap interval\n");
}
-#else
- printf("Testing with default swap interval\n");
-#endif
glXGetSyncValuesOML(dpy, win, &start_ust, &start_msc, &start_sbc);
if (start_sbc != 0) {