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

> On 10/21/2013 11:29 AM, Paul Berry wrote:
>
>> On 15 October 2013 17:32, Ian Romanick <i...@freedesktop.org> wrote:
>>
>>  From: Ian Romanick <ian.d.roman...@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.
_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to