[Piglit] [PATCH 08/16] msaa/formats: Make it possible to specify a test set on the command line.

Paul Berry stereotype441 at gmail.com
Fri Jun 15 08:32:28 PDT 2012


---
 tests/spec/ext_framebuffer_multisample/formats.cpp |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/tests/spec/ext_framebuffer_multisample/formats.cpp b/tests/spec/ext_framebuffer_multisample/formats.cpp
index d2386ad..a55f053 100644
--- a/tests/spec/ext_framebuffer_multisample/formats.cpp
+++ b/tests/spec/ext_framebuffer_multisample/formats.cpp
@@ -506,7 +506,7 @@ test_format(const struct format_desc *format)
 void
 print_usage_and_exit(char *prog_name)
 {
-	printf("Usage: %s <num_samples>\n", prog_name);
+	printf("Usage: %s <num_samples> [test_set]\n", prog_name);
 	piglit_report_result(PIGLIT_FAIL);
 }
 
@@ -514,13 +514,20 @@ print_usage_and_exit(char *prog_name)
 extern "C" void
 piglit_init(int argc, char **argv)
 {
-	if (argc < 2)
+	if (argc < 2 || argc > 3)
 		print_usage_and_exit(argv[0]);
+
+	/* First argument (required): num_samples */
 	char *endptr = NULL;
 	num_samples = strtol(argv[1], &endptr, 0);
 	if (endptr != argv[1] + strlen(argv[1]))
 		print_usage_and_exit(argv[0]);
 
+	/* Second argument (optional): test_set */
+	int test_set = 0; /* Default to core */
+	if (argc == 3)
+		test_set = fbo_lookup_test_set(argv[2]);
+
 	piglit_require_gl_version(30);
 
 	/* Skip the test if num_samples > GL_MAX_SAMPLES */
@@ -529,7 +536,7 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	fbo_formats_init_test_set(0 /* core formats */,
+	fbo_formats_init_test_set(test_set,
 				  GL_TRUE /* print_options */);
 	test_pattern_vec4 = new ColorGradientSunburst(GL_UNSIGNED_NORMALIZED);
 	test_pattern_vec4->compile();
-- 
1.7.7.6



More information about the Piglit mailing list