[Piglit] [PATCH 2/3] fbo-formats: add new fbo_use_test_set() function

Brian Paul brianp at vmware.com
Mon Feb 29 15:51:55 UTC 2016


As an alternative to fbo_formats_init() which takes a single string.
fbo_formats_init() doesn't work for tests which may take both a format
set name and some other arguments.
---
 tests/fbo/fbo-formats.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/fbo/fbo-formats.h b/tests/fbo/fbo-formats.h
index f5e9150..0e2af5f 100644
--- a/tests/fbo/fbo-formats.h
+++ b/tests/fbo/fbo-formats.h
@@ -664,6 +664,24 @@ fbo_formats_init(int argc, char **argv, GLboolean print_options)
 	fbo_formats_init_test_set(test_set_index, print_options);
 }
 
+/**
+ * Try to use the given format test set (such as "GL_EXT_texture_sRGB")
+ * This is an alternative to the fbo_formats_init() function above.
+ * \return true if success, false if unknown test set name
+ */
+bool
+fbo_use_test_set(const char *test_set, bool print_options)
+{
+	int test_set_index = fbo_lookup_test_set(test_set);
+	if (test_set_index >= 0) {
+		fbo_formats_init_test_set(test_set_index,
+					  (GLboolean) print_options);
+		return true;
+	} else {
+		return false;
+	}
+}
+
 static void add_result(bool *all_skip, enum piglit_result *end_result,
 		       enum piglit_result new_result)
 {
-- 
1.9.1



More information about the Piglit mailing list