[11/15] tests/fbo-storage-formats: enumerate subtests

Submitted by Dylan Baker on Jan. 23, 2018, 1:22 a.m.

Details

Message ID c038fa27b4f46d569b70c31d89a0f6d0e201dda7.1516670408.git-series.dylan@pnwbakers.com
State New
Headers show
Series "Series without cover letter" ( rev: 13 12 11 10 9 8 7 6 5 4 3 2 ) in Piglit

Not browsing as part of any series.

Commit Message

Dylan Baker Jan. 23, 2018, 1:22 a.m.
---
 tests/fbo/fbo-storage-formats.c | 41 ++++++++++++++++++++++------------
 1 file changed, 27 insertions(+), 14 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/fbo/fbo-storage-formats.c b/tests/fbo/fbo-storage-formats.c
index 7f13684..ee22883 100644
--- a/tests/fbo/fbo-storage-formats.c
+++ b/tests/fbo/fbo-storage-formats.c
@@ -32,31 +32,17 @@ 
 
 #include "piglit-util-gl.h"
 
-PIGLIT_GL_TEST_CONFIG_BEGIN
-
-	config.supports_gl_compat_version = 10;
-
-	config.window_visual = PIGLIT_GL_VISUAL_RGB;
-	config.khr_no_error_support = PIGLIT_NO_ERRORS;
-
-PIGLIT_GL_TEST_CONFIG_END
-
 #define EXT_packed_depth_stencil 1
 #define ARB_framebuffer_object 2
 #define ARB_texture_rg 3
 #define MAX_EXT 4
 
-static GLboolean have_extension[MAX_EXT];
-
-
-
 struct format_info
 {
 	GLenum format;
 	GLuint extension;
 };
 
-
 static const struct format_info formats[] = {
 	{ GL_RGB, 0 },
 	{ GL_R3_G3_B2, 0 },
@@ -158,6 +144,33 @@  static const GLenum invalid_formats[] = {
 };
 
 
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+	config.supports_gl_compat_version = 10;
+
+	config.window_visual = PIGLIT_GL_VISUAL_RGB;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
+
+	const char *names[64];
+
+	int t = 0;
+	for (int i = 0; i < ARRAY_SIZE(formats); i++) {
+		names[t] = piglit_get_gl_enum_name(formats[i].format);
+		++t;
+	}
+	for (int i = 0; i < ARRAY_SIZE(invalid_formats); i++) {
+		names[t] = piglit_get_gl_enum_name(invalid_formats[i]);
+		++t;
+	}
+	names[++t] = NULL;
+
+	config.all_subtests = names;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLboolean have_extension[MAX_EXT];
+
+
 static enum piglit_result
 test(void)
 {