[Piglit] [v4 1/4] util: egl: support for skipping unsupported extension tests

Topi Pohjolainen topi.pohjolainen at intel.com
Wed May 1 23:56:03 PDT 2013


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 tests/util/piglit-util-egl.c | 9 +++++++++
 tests/util/piglit-util-egl.h | 5 +++++
 2 files changed, 14 insertions(+)

diff --git a/tests/util/piglit-util-egl.c b/tests/util/piglit-util-egl.c
index 1087429..5a9f0a9 100644
--- a/tests/util/piglit-util-egl.c
+++ b/tests/util/piglit-util-egl.c
@@ -84,3 +84,12 @@ piglit_is_egl_extension_supported(EGLDisplay egl_dpy, const char *name)
 
 	return piglit_is_extension_in_string(egl_extension_list, name);
 }
+
+void piglit_require_egl_extension(const char *name)
+{
+	if (!piglit_is_egl_extension_supported(eglGetCurrentDisplay(), name)) {
+		printf("Test requires %s\n", name);
+		piglit_report_result(PIGLIT_SKIP);
+		exit(1);
+	}
+}
diff --git a/tests/util/piglit-util-egl.h b/tests/util/piglit-util-egl.h
index 7faccf4..2586141 100644
--- a/tests/util/piglit-util-egl.h
+++ b/tests/util/piglit-util-egl.h
@@ -56,6 +56,11 @@ piglit_check_egl_error(EGLint expected_error);
  */
 bool piglit_is_egl_extension_supported(EGLDisplay egl_dpy, const char *name);
 
+/**
+ * \brief Checks for EGL extension and skips if not supported
+ */
+void piglit_require_egl_extension(const char *name);
+
 #ifdef __cplusplus
 } /* end extern "C" */
 #endif
-- 
1.8.1.2



More information about the Piglit mailing list