[Piglit] [PATCH 1/4] piglt: Add support for subtests

Tom Stellard tom at stellard.net
Wed Dec 5 11:36:37 PST 2012


On Wed, Dec 05, 2012 at 11:27:06AM -0800, Eric Anholt wrote:
> Tom Stellard <tom at stellard.net> writes:
> 
> > From: Tom Stellard <thomas.stellard at amd.com>
> >
> > Subtests allow a test to produce more than one result.  This is useful
> > for tests where it may be convenient to combine several somewhat
> > unrelated tests into a single program.  For example, a cl test like:
> >
> > kernel void test(TYPE *out, TYPE *in) {
> > 	out[0] = some_builtin_function(in[0], in[1]);
> > }
> >
> > That uses only one kernel, but recompiles it several times with different
> > definitions of the macro 'TYPE' in order to test the builtin with all
> > the possible types.
> >
> > To take advantage of the subtest feature, programs should output an
> > additional PIGLIT line similar to the following example:
> >
> > PIGLIT: {'subtests' : {'testA' : 'pass', 'testB : 'fail'}}
> 
> This sounds pretty cool.  The downside I see is that a lot of tests that
> might use it that are structured a loop executing subtests will have to
> save off the results so it can accumulate them into a string later.  How
> about instead separate lines:
> 
> PIGLIT subtest testA: pass
> PIGLIT subtest testB: fail
>

This is a good idea, let me try it.

-Tom

 
> which means we could have a nice helper function for
> 
> piglit_report_subtest_result(const char *name, enum piglit_result result)




More information about the Piglit mailing list