[Piglit] [PATCH 3/5] GL_ARB_texture_buffer_object/formats: Add real support for testing GL core.

Chad Versace chad.versace at linux.intel.com
Tue Nov 13 12:43:49 PST 2012


On 11/01/2012 11:36 AM, Eric Anholt wrote:
> Thanks to waffle we can finally do this.
> ---
>  tests/spec/arb_texture_buffer_object/formats.c |   95 +++++++++++++++++-------
>  1 file changed, 68 insertions(+), 27 deletions(-)
> 
> diff --git a/tests/spec/arb_texture_buffer_object/formats.c b/tests/spec/arb_texture_buffer_object/formats.c
> index 610c2fa..d1ff57d 100644
> --- a/tests/spec/arb_texture_buffer_object/formats.c
> +++ b/tests/spec/arb_texture_buffer_object/formats.c
> @@ -28,16 +28,6 @@
>  #define _GNU_SOURCE
>  #include "piglit-util-gl-common.h"
>  
> -PIGLIT_GL_TEST_CONFIG_BEGIN
> -
> -	config.supports_gl_compat_version = 10;
> -
> -	config.window_width = 200;
> -	config.window_height = 500;
> -	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_ALPHA;
> -
> -PIGLIT_GL_TEST_CONFIG_END

> +int
> +main(int argc, char *argv[])
> +{
> +	struct piglit_gl_test_config config;
> +
> +	test_vs = find_arg(argc, argv, "vs");
> +	if (!test_vs && !find_arg(argc, argv, "fs"))
> +		usage(argv[0]);
> +
> +	test_arb = find_arg(argc, argv, "arb");
> +	if (!test_arb && !find_arg(argc, argv, "core"))
> +		usage(argv[0]);
> +
> +	piglit_gl_test_config_init(&config);
> +
> +	config.init = piglit_init;
> +	config.display = piglit_display;
> +
> +	if (test_arb)
> +		config.supports_gl_compat_version = 10;
> +	else
> +		config.supports_gl_core_version = 31;
> +
> +	config.window_width = 200;
> +	config.window_height = 500;
> +	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_ALPHA;
> +
> +	piglit_gl_test_run(argc, argv, &config);
> +
> +	assert(false);
> +	return 0;
> +}

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>

I have a few open-ended comments on the approach you used here.

One of the original goals of switching Piglit to Waffle and adding
a config block to the top of each test was to allow exactly what you're
accomplishing here: choosing the context flavor with command line arguments.
It looks like your testing needs outpaced Piglit's implementation.

I've wanted to add standard command line arguments, similar to -fbo and -auto,
and modify the config block format to provide a standard way for every test to
do this. It's still on the drawing board, though. If you have any opinions
on how you want the final result to look to behave, I'd like to hear them. 



More information about the Piglit mailing list