[Piglit] [PATCH] Updated sanity.py to reflect new Piglit version of the read pixels sanity test.

Dylan Baker baker.dylan.c at gmail.com
Tue Oct 21 12:11:32 PDT 2014


On Tuesday, October 21, 2014 02:39:06 PM Ilia Mirkin wrote:
> On Tue, Oct 21, 2014 at 2:35 PM, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> > Hi Laura,
> >
> > You should rebase your piglit work, this patch wont apply to master, as
> > I landed some changes to get rid of the need for a bunch of the test
> > wrappers. The big change is that the -auto and -fbo stuff is added
> > automatically by the class now.
> >
> > It's also worth noting that the nested dictionary structure of
> > profile.tests actually gets flattened into a '/' separated single level
> > dictionary before the tests run, the way the code is written you can
> > just specify them as a flat dictionary to begin with. That's how the
> > current code works.
> >
> > All you really need to do is something like the following (I haven't
> > tested this but it should be close):
> >
> > from framework.profile import TestProfile
> > from framework.test import PiglitGLTest
> >
> > __all__ = ['profile']
> >
> > profile.tests['spec/!OpenGL 1.0/gl-1.0-readpixsanity'] = \
> >         PiglitGLTest('gl-1.0-readpixsanity', run_concurrent=True)
> 
> I would like to voice an objection against specifying tests that
> way... it goes against the style in all.py. Also I have some changes
> in mind (but haven't had time to work on them yet) to propose a much
> cleaner/etc way of specifying tests, but which will be much easier to
> convert to if things are written in the "dictionary" style.
> 
>   -ilia
> 

This is how sanity.py is currently implemented. If we want to change
that it should be done in a separate patch.

As an aside, we should chat about your plans Ilia, cause I've been
working on replacing the nested structure with a non nested structure
and it's given some wins for startup time reduction. But If you have
something better in mind I don't want to waste my time.

Dylan

> >
> >
> > Dylan
> >
> > On Tuesday, October 21, 2014 10:02:09 AM Laura Ekstrand wrote:
> >> ---
> >>  tests/sanity.py | 32 +++++++++++++++++++++++++++++---
> >>  1 file changed, 29 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/tests/sanity.py b/tests/sanity.py
> >> index 0e0e038..0a3c49c 100644
> >> --- a/tests/sanity.py
> >> +++ b/tests/sanity.py
> >> @@ -3,10 +3,36 @@
> >>  #
> >>
> >>  from framework.profile import TestProfile
> >> -from framework.gleantest import GleanTest
> >> +from framework.exectest import PiglitTest
> >> +
> >> +# Helper functions from all.py:
> >> +# Quick wrapper for PiglitTest for our usual concurrent args.
> >> +def plain_test(args):
> >> +    return PiglitTest(args.split() + ['-auto'])
> >> +
> >> +def add_single_param_test_set(group, name, *params):
> >> +    for param in params:
> >> +        group[name + '-' + param] = plain_test(name + ' ' + param)
> >> +
> >> +def add_plain_test(group, args):
> >> +    assert '/' not in args, args
> >> +    group[args] = plain_test(args)
> >> +
> >> +def concurrent_test(args):
> >> +    test = plain_test(args + ' -fbo')
> >> +    test.run_concurrent = True
> >> +    return test
> >> +
> >> +def add_concurrent_test(group, args):
> >> +    assert '/' not in args, args
> >> +    group[args] = concurrent_test(args)
> >>
> >>  __all__ = ['profile']
> >>
> >>  profile = TestProfile()
> >> -profile.tests['glean/basic'] = GleanTest('basic')
> >> -profile.tests['glean/readPixSanity'] = GleanTest('readPixSanity')
> >> +
> >> +spec = {}
> >> +profile.tests['spec'] = spec
> >> +gl10 = {}
> >> +spec['!OpenGL 1.0'] = gl10
> >> +add_concurrent_test(gl10, 'gl-1.0-readpixsanity')
> >> --
> >> 2.1.0
> >>
> >> _______________________________________________
> >> Piglit mailing list
> >> Piglit at lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/piglit
> >
> > _______________________________________________
> > Piglit mailing list
> > Piglit at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit
> >
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141021/65285153/attachment.sig>


More information about the Piglit mailing list