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

Submitted by Dylan Baker on Dec. 3, 2018, 6:13 p.m.

Details

Message ID 20181203181358.12095-10-dylan@pnwbakers.com
State New
Headers show
Series "Convert a number of tests to use subtest framework" ( rev: 17 16 15 14 ) in Piglit

Not browsing as part of any series.

Commit Message

Dylan Baker Dec. 3, 2018, 6:13 p.m.
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(+)

Patch hide | download patch | download mbox

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
 	 */