[Piglit] [PATCH 1/2] piglit-framework-gl: add piglit_khr_no_error for detecting when khr_no_error enabled

Timothy Arceri tarceri at itsqueeze.com
Sat May 13 13:02:45 UTC 2017


This will be useful for disabling error tests inside piglit tests that are largely
error free.
---
 tests/util/piglit-framework-gl.c | 2 ++
 tests/util/piglit-framework-gl.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c
index ecb1401..a8e02d2 100644
--- a/tests/util/piglit-framework-gl.c
+++ b/tests/util/piglit-framework-gl.c
@@ -29,20 +29,21 @@
 #include <math.h>
 
 #include "piglit-util-gl.h"
 #include "piglit-framework-gl/piglit_gl_framework.h"
 
 struct piglit_gl_framework *gl_fw;
 
 const char *piglit_binary_name;
 bool piglit_dump_png = false;
 bool piglit_use_fbo = false;
+bool piglit_khr_no_error = false;
 int piglit_automatic = 0;
 unsigned piglit_winsys_fbo = 0;
 
 int piglit_width;
 int piglit_height;
 
 static void
 process_args(int *argc, char *argv[], unsigned *force_samples,
 	     struct piglit_gl_test_config *config);
 
@@ -153,20 +154,21 @@ process_args(int *argc, char *argv[], unsigned *force_samples,
 			for (i = j + 1; i < *argc; i++) {
 				argv[i - 2] = argv[i];
 			}
 			*argc -= 2;
 			j -= 2;
 		} else if (!strncmp(argv[j], "-samples=", 9)) {
 			*force_samples = atoi(argv[j]+9);
 			delete_arg(argv, *argc, j--);
 			*argc -= 1;
 		} else if (!strcmp(argv[j], "-khr_no_error")) {
+			piglit_khr_no_error = true;
 			delete_arg(argv, *argc, j--);
 			*argc -= 1;
 			if (config->khr_no_error_support ==
 			    PIGLIT_UNKNOWN_ERROR_STATUS) {
 				fprintf(stderr,
 					"khr_no_error_support unknown "
 					"skipping test!\n");
 				piglit_report_result(PIGLIT_SKIP);
 			} else if (config->khr_no_error_support ==
 				   PIGLIT_HAS_ERRORS) {
diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h
index afaa6bb..992f28a 100644
--- a/tests/util/piglit-framework-gl.h
+++ b/tests/util/piglit-framework-gl.h
@@ -291,20 +291,21 @@ piglit_gl_test_run(int argc, char *argv[],
                                                                              \
                 assert(false);                                               \
                 return 0;                                                    \
         }
 
 extern int piglit_automatic;
 
 extern int piglit_width;
 extern int piglit_height;
 extern bool piglit_use_fbo;
+extern bool piglit_khr_no_error;
 extern unsigned int piglit_winsys_fbo;
 extern struct piglit_gl_framework *gl_fw;
 
 void piglit_swap_buffers(void);
 void piglit_present_results();
 void piglit_post_redisplay(void);
 void piglit_set_keyboard_func(void (*func)(unsigned char key, int x, int y));
 void piglit_set_reshape_func(void (*func)(int w, int h));
 
 /**
-- 
2.9.3



More information about the Piglit mailing list