[Piglit] [PATCH] gbm: add event loop and exit after 1 run

Jordan Justen jordan.l.justen at intel.com
Tue Nov 12 21:41:56 PST 2013


If -auto is not used when the piglit platform is gbm, then the test
will hit an abort call. Additionally, it will not actually call
the test display function.

After this change, the test will run once and exit, similar
to what were to happen if the user had pressed the escape key
with other frameworks.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 tests/util/piglit-framework-gl/piglit_gbm_framework.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/util/piglit-framework-gl/piglit_gbm_framework.c b/tests/util/piglit-framework-gl/piglit_gbm_framework.c
index 4df3861..859a7c9 100644
--- a/tests/util/piglit-framework-gl/piglit_gbm_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_gbm_framework.c
@@ -31,6 +31,20 @@
 static void
 enter_event_loop(struct piglit_winsys_framework *winsys_fw)
 {
+	const struct piglit_gl_test_config *test_config = winsys_fw->wfl_fw.gl_fw.test_config;
+
+	enum piglit_result result = PIGLIT_PASS;
+
+	if (test_config->display)
+		result = test_config->display();
+
+	if (piglit_automatic)
+		piglit_report_result(result);
+
+	/* gbm has no input, so we exit immediately, as if the user
+	 * had pressed escape.
+	 */
+	exit(0);
 }
 
 static void
-- 
1.8.4.2



More information about the Piglit mailing list