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

Paul Berry stereotype441 at gmail.com
Mon Oct 21 17:09:31 PDT 2013


On 21 October 2013 16:55, Chad Versace <chad.versace at linux.intel.com> wrote:

> 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.
>
>
Technically you're right, but without a void * parameter to subtest_func(),
it can only generate subtests that are drawn from a fixed set of
possibilities that's determined at compile-time, since the only way for the
tests to be different from each other is by using different function
pointers, and the set of functions available is fixed at compile time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20131021/b2a104aa/attachment.html>


More information about the Piglit mailing list