[Piglit] [PATCH 01/15] tests/util: Add config value to enumerate subtests

Dylan Baker dylan at pnwbakers.com
Tue Jan 23 01:22:02 UTC 2018


This adds a new member to the GL config struct for informing the python
framework the number and order of subtests that will be run (if any). If
this value is unset then no subtests are expected.
---
 tests/util/piglit-framework-gl.c | 13 +++++++++++++
 tests/util/piglit-framework-gl.h | 11 +++++++++++
 2 files changed, 24 insertions(+)

diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c
index 1b2078d..1ce5474 100644
--- a/tests/util/piglit-framework-gl.c
+++ b/tests/util/piglit-framework-gl.c
@@ -318,3 +318,16 @@ piglit_get_selected_tests(const char ***selected_subtests)
 	*selected_subtests = gl_fw->test_config->selected_subtests;
 	return gl_fw->test_config->num_selected_subtests;
 }
+
+void
+piglit_gl_enumerate_subtests(const struct piglit_gl_test_config *config)
+{
+	if (config->all_subtests) {
+		printf("PIGLIT: {\"enumerate subtests\": [\"%s\"", config->all_subtests[0]);
+		for (int i = 1; config->all_subtests[i]; i++) {
+			printf(", \"%s\"", config->all_subtests[i]);
+		}
+		printf("]}\n");
+		fflush(stdout);
+	}
+}
diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h
index 970fd55..d36c4f0 100644
--- a/tests/util/piglit-framework-gl.h
+++ b/tests/util/piglit-framework-gl.h
@@ -213,6 +213,13 @@ struct piglit_gl_test_config {
 	 * enum used for markin test as supporting KHR_no_error or not.
 	 */
 	enum piglit_khr_no_error_support khr_no_error_support;
+
+	/**
+	 * Null terminated list of subtests to be enumerated.
+	 *
+	 * Each subtest *must* be run in the order reported by this list.
+	 */
+	const char **all_subtests;
 };
 
 /**
@@ -246,6 +253,9 @@ void
 piglit_gl_test_run(int argc, char *argv[],
 		   const struct piglit_gl_test_config *config);
 
+void
+piglit_gl_enumerate_subtests(const struct piglit_gl_test_config *config);
+
 #ifdef __cplusplus
 #  define PIGLIT_EXTERN_C_BEGIN extern "C" {
 #  define PIGLIT_EXTERN_C_END   }
@@ -287,6 +297,7 @@ piglit_gl_test_run(int argc, char *argv[],
                 }                                                            \
                                                                              \
                 piglit_gl_process_args(&argc, argv, &config);                \
+                piglit_gl_enumerate_subtests(&config);                       \
                 piglit_gl_test_run(argc, argv, &config);                     \
                                                                              \
                 assert(false);                                               \

base-commit: 736496667329bf73a706aebec6f8287078df79ae
-- 
git-series 0.9.1


More information about the Piglit mailing list