[Piglit] [PATCH 06/29] util: Check that glx is supported in the selected platform
Pauli Nieminen
pauli.nieminen at linux.intel.com
Mon May 21 11:08:41 PDT 2012
Check in runtime if current platform is glx before trying to check glX
versions or extensions.
Signed-off-by: Pauli Nieminen <pauli.nieminen at linux.intel.com>
---
tests/util/piglit-glx-util.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/tests/util/piglit-glx-util.c b/tests/util/piglit-glx-util.c
index 069ea72..3faab33 100644
--- a/tests/util/piglit-glx-util.c
+++ b/tests/util/piglit-glx-util.c
@@ -27,6 +27,9 @@
#include "piglit-util.h"
#include "piglit-glx-util.h"
+#ifdef USE_WAFFLE
+#include <waffle/waffle.h>
+#endif
#ifndef GLXBadProfileARB
#define GLXBadProfileARB 13
@@ -147,12 +150,24 @@ piglit_is_glx_extension_supported(Display *dpy, const char *name)
const char *const glx_extension_list =
glXQueryExtensionsString(dpy, screen);
+#ifdef USE_WAFFLE
+ if (glutGetPlatform() != WAFFLE_PLATFORM_GLX)
+ return false;
+#endif
+
return piglit_is_extension_in_string(glx_extension_list, name);
}
void
piglit_require_glx_extension(Display *dpy, const char *name)
{
+#ifdef USE_WAFFLE
+ if (glutGetPlatform() != WAFFLE_PLATFORM_GLX) {
+ fprintf(stderr, "GLX test running in platform without GLX\n");
+ piglit_report_result(PIGLIT_SKIP);
+ }
+#endif
+
if (!piglit_is_glx_extension_supported(dpy, name)) {
fprintf(stderr, "Test requires %s\n", name);
piglit_report_result(PIGLIT_SKIP);
@@ -166,6 +181,13 @@ piglit_require_glx_version(Display *dpy, int major, int minor)
int glxMajor;
int glxMinor;
+#ifdef USE_WAFFLE
+ if (glutGetPlatform() != WAFFLE_PLATFORM_GLX) {
+ fprintf(stderr, "GLX test running in platform without GLX\n");
+ piglit_report_result(PIGLIT_SKIP);
+ }
+#endif
+
if (! glXQueryVersion(dpy, & glxMajor, & glxMinor)) {
fprintf(stderr, "Could not query GLX version!\n");
piglit_report_result(PIGLIT_FAIL);
--
1.7.5.4
More information about the Piglit
mailing list