[Piglit] [PATCH 3/3] framework: parse piglit core args during piglit_gl_test_config_init()

Chad Versace chad.versace at linux.intel.com
Mon Jul 29 10:46:48 PDT 2013


On 07/26/2013 01:11 PM, Paul Berry wrote:
> This makes it safe to examine argc and argv between
> PIGLIT_GL_TEST_CONFIG_BEGIN and PIGLIT_GL_TEST_CONFIG_END, since
> piglit fragmework arguments have already been stripped away.
>
> That in turn means that the following tests can use
> PIGLIT_GL_TEST_CONFIG_{BEGIN,END} instead of having to declare their
> own main() functions:
>
> - spec/arb_texture_buffer_object/formats.c
> - spec/gl-3.0/required-renderbuffer-attachment-formats.c
> - spec/gl-3.0/required-sized-texture-formats.c
> - spec/gl-3.0/required-texture-attachment-formats.c
> - spec/gles-3.0/oes_compressed_etc2_texture-miptree.c
> ---
>   tests/spec/arb_texture_buffer_object/formats.c     | 18 ++------------
>   .../required-renderbuffer-attachment-formats.c     | 15 ++----------
>   tests/spec/gl-3.0/required-sized-texture-formats.c | 15 ++----------
>   .../gl-3.0/required-texture-attachment-formats.c   | 15 ++----------
>   .../gles-3.0/oes_compressed_etc2_texture-miptree.c | 16 ++-----------
>   tests/util/piglit-framework-gl.c                   | 28 ++++++++++++----------
>   tests/util/piglit-framework-gl.h                   |  8 ++++---
>   tests/util/sized-internalformats.c                 |  2 --
>   8 files changed, 31 insertions(+), 86 deletions(-)


> diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c
> index ece5968..46325eb 100644
> --- a/tests/util/piglit-framework-gl.c
> +++ b/tests/util/piglit-framework-gl.c
> @@ -39,10 +39,22 @@ unsigned piglit_winsys_fbo = 0;
>   int piglit_width;
>   int piglit_height;
>
> +static void
> +process_args(int *argc, char *argv[], unsigned *force_samples);
> +
>   void
> -piglit_gl_test_config_init(struct piglit_gl_test_config *config)
> +piglit_gl_test_config_init(int *argc, char *argv[],
> +			   struct piglit_gl_test_config *config)
                            ^^^

Small formatting problem. 'struct' should be aligned with 'int'.

I found the movement of process_args() from piglit_gl_test_run() to piglit_gl_test_config_init()
a subtle change. But I don't have any suggestion regarding it.

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


More information about the Piglit mailing list