[Piglit] [PATCH v3 2/5] util: Add common framework for command-line invoked subtests

Chad Versace chad.versace at linux.intel.com
Mon Oct 21 16:55:16 PDT 2013


On 10/21/2013 11:29 AM, Paul Berry wrote:
> On 15 October 2013 17:32, Ian Romanick <idr at freedesktop.org> wrote:
>
>> From: Ian Romanick <ian.d.romanick at intel.com>



>> @@ -43,6 +43,20 @@ enum piglit_gl_visual {
>>   };
>>
>>   /**
>> + * An idividual subtest that makes up part of a test group.
>> + */
>> +struct piglit_gl_subtest {
>> +       /** Name of the subtest as it will appear in the log. */
>> +       const char *name;
>> +
>> +       /** Command line name used to select this test. */
>> +       const char *option;
>> +
>> +       /** Function that implements the test. */
>> +       enum piglit_result (*subtest_func)(void);
>>
>
> Would you have any objection to adding a void * to this structure, which
> would then get passed to subtest_func?  That would give the test
> implementor extra flexibility if they want to share a single subtest_func
> between multiple similar subtests.  It would also allow for the possibility
> that the set of available subtests is determined at run time rather than
> compile time.

I second Paul's request to add a void* parameter.

However, I don't see how the presence of a void* parameter enables a test
to determine the list of available subtests at runtime. A test can already
do that at runtime by generating piglit_gl_test_config::subtests in main().
Nothing requires that the test declare that structure statically.



More information about the Piglit mailing list