summaryrefslogtreecommitdiff
path: root/tests/egl/egl-util.h
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2014-05-06 12:10:58 -0700
committerChad Versace <chad.versace@linux.intel.com>2014-05-20 18:10:52 -0700
commit850a069dd285d587c05f9330dbe7a60ad2810c74 (patch)
tree88e54381af59c9cc34b3a0de7410bbfb4af9e92c /tests/egl/egl-util.h
parentb2dad87db694a28c72e31bc9e6dca6854e903463 (diff)
egl/utils: Prepare egl_util_run to be called from piglit subtests.
For future EGL tests, I want to be able to use Chad's new piglit EGL subtest infrastructure, and use the EGL utilities convenience functions to set up a window, surface, and context. Currently, egl_util_run calls piglit_report_result() after calling test.draw. This means no other subtests get run. Add a new field in egl_test to specify whether piglit_report_result() should be called, and another field to store the result returned from test.draw. Make sure that egl_util_run() tears down the window, surface, and context. Previously it was relying on cleanup being done when the process died, which won't work if we want to run a second subtest in the same thread. TODO: There's still some work that could be done here to ensure the initialization steps in egl_util_run aren't done twice (e.g. calling XOpenDisplay, eglInitialize, etc.) However, the tests pass in their current state, so there's no reason they shouldn't be merged. Thanks a bunch to Chad Versace and Rob Bradford, who helped me debug this code! Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Cc: Rob Bradford <rob@linux.intel.com>
Diffstat (limited to 'tests/egl/egl-util.h')
-rw-r--r--tests/egl/egl-util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/egl/egl-util.h b/tests/egl/egl-util.h
index e1caa9432..f5c74fdc8 100644
--- a/tests/egl/egl-util.h
+++ b/tests/egl/egl-util.h
@@ -35,6 +35,7 @@ struct egl_test {
enum piglit_result (*draw)(struct egl_state *state);
EGLint window_width;
EGLint window_height;
+ bool stop_on_failure;
};
static const EGLint egl_default_attribs[] = {
@@ -60,7 +61,7 @@ EGLSurface
egl_util_create_pixmap(struct egl_state *state,
int width, int height, const EGLint *attribs);
-int egl_util_run(const struct egl_test *test, int argc, char *argv[]);
+enum piglit_result egl_util_run(const struct egl_test *test, int argc, char *argv[]);
int
egl_probe_front_pixel_rgb(struct egl_state *state,