[Piglit] [PATCH v2 10/19] tests/gl-1.0-beginend-coverage: enumerate subtests

Dylan Baker dylan at pnwbakers.com
Mon Dec 3 18:13:49 UTC 2018


This doesn't add support for running specific subtests, but it does
enumerate the ones that exist.
---
 tests/spec/gl-1.0/beginend-coverage.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/spec/gl-1.0/beginend-coverage.c b/tests/spec/gl-1.0/beginend-coverage.c
index 67792296a..40ff69a8b 100644
--- a/tests/spec/gl-1.0/beginend-coverage.c
+++ b/tests/spec/gl-1.0/beginend-coverage.c
@@ -895,11 +895,37 @@ test_endlist()
 	return true;
 }
 
+static void
+enumerate_subtests(void) {
+	const char * subtests[ARRAY_SIZE(ok_tests) + ARRAY_SIZE(error_tests) +
+			      ARRAY_SIZE(error_only_tests) +
+			      ARRAY_SIZE(nondlist_error_tests) + 2];
+	unsigned i = 0;
+	for (unsigned j = 0; j < ARRAY_SIZE(ok_tests); ++j, ++i) {
+		subtests[i] = ok_tests[j].name;
+	}
+	for (unsigned j = 0; j < ARRAY_SIZE(error_tests); ++j, ++i) {
+		subtests[i] = error_tests[j].name;
+	}
+	for (unsigned j = 0; j < ARRAY_SIZE(error_only_tests); ++j, ++i) {
+		subtests[i] = error_only_tests[j].name;
+	}
+	for (unsigned j = 0; j < ARRAY_SIZE(nondlist_error_tests); ++j, ++i) {
+		subtests[i] = nondlist_error_tests[j].name;
+	}
+	subtests[i++] = "glEndList";
+	subtests[i] = NULL;
+
+	piglit_register_subtests(subtests);
+}
+
 void
 piglit_init(int argc, char **argv)
 {
 	bool pass;
 
+	enumerate_subtests();
+
 	/* Set up some state to be used by our various test
 	 * functions
 	 */
-- 
2.19.2



More information about the Piglit mailing list