[Piglit] [PATCH 5/6] framework: observe PIGLIT_NO_FAST_SKIP in ShaderTest::__init__()
Dylan Baker
dylan at pnwbakers.com
Tue Oct 24 16:51:09 UTC 2017
Quoting Brian Paul (2017-10-23 10:37:39)
> On 10/18/2017 06:41 PM, Dylan Baker wrote:
> > Quoting Brian Paul (2017-10-12 21:23:09)
> >> If PIGLIT_NO_FAST_SKIP is defined, the FastSkip/FastSkipMixin classes
> >> are no-ops. Therefore, the GL/GLSL version info collected in
> >> ShaderTest::__init()__ isn't used. Skipping the shader test parsing
> >> is a big win for reducing start-up time on Windows. There's not much
> >> difference either way on Linux.
> >> ---
> >> framework/test/shader_test.py | 30 +++++++++++++++++++-----------
> >> 1 file changed, 19 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
> >> index 7f3d876..a3fb8e2 100644
> >> --- a/framework/test/shader_test.py
> >> +++ b/framework/test/shader_test.py
> >> @@ -155,17 +155,25 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest):
> >> """
> >>
> >> def __init__(self, filename):
> >> - parser = Parser(filename)
> >> - parser.parse()
> >> -
> >> - super(ShaderTest, self).__init__(
> >> - [parser.prog, parser.filename],
> >> - run_concurrent=True,
> >> - gl_required=parser.gl_required,
> >> - gl_version=parser.gl_version,
> >> - gles_version=parser.gles_version,
> >> - glsl_version=parser.glsl_version,
> >> - glsl_es_version=parser.glsl_es_version)
> >> + if bool(os.environ.get('PIGLIT_NO_FAST_SKIP', False)):
> >> + # No need to parse the shader test file if we've disabled
> >> + # the FastSkip feature.
> >> + super(ShaderTest, self).__init__(
> >> + ['shader_runner', filename],
> >> + run_concurrent=True,)
> >> + else:
> >> + parser = Parser(filename)
> >> + parser.parse()
> >> +
> >> + super(ShaderTest, self).__init__(
> >> + [parser.prog, parser.filename],
> >> + run_concurrent=True,
> >> + gl_required=parser.gl_required,
> >> + gl_version=parser.gl_version,
> >> + gles_version=parser.gles_version,
> >> + glsl_version=parser.glsl_version,
> >> + glsl_es_version=parser.glsl_es_version)
> >> +
> >>
> >> @PiglitBaseTest.command.getter
> >> def command(self):
> >> --
> >> 1.9.1
> >>
> >> _______________________________________________
> >> Piglit mailing list
> >> Piglit at lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/piglit
> >
> > Does it make more sense to just put this logic in the parser and have it return
> > an object of Nones immediatly if PIGLIT_NO_FAST_SKIP is set?
>
> I don't think it matters. Your call.
>
> If it's OK as is, R-b?
>
> -Brian
>
I guess it's fine as-is,
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20171024/28fd61be/attachment.sig>
More information about the Piglit
mailing list