[Piglit] [PATCH] generators: fix incorrect generated_tests/spec/glsl-110, etc. dir names

Dylan Baker dylan at pnwbakers.com
Fri Nov 17 20:35:57 UTC 2017


Quoting Brian Paul (2017-11-17 12:03:40)
> We were generating tests both in spec/glsl-1.10/ and spec/glsl-110/.
> This changes the later to match the former.
> ---
>  generated_tests/gen_variable_index_write_tests.py | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/generated_tests/gen_variable_index_write_tests.py b/generated_tests/gen_variable_index_write_tests.py
> index 0c06dcd..2615d9a 100644
> --- a/generated_tests/gen_variable_index_write_tests.py
> +++ b/generated_tests/gen_variable_index_write_tests.py
> @@ -198,6 +198,11 @@ class TestParams(object):
>              ret += ' '
>          return ret
>  
> +    @utils.lazy_property
> +    def formated_version(self):
> +        # Note: GLSLVersion::float() does the division by 100

The C++ syntax is pretty uncommon in python, "GLSLVersions.float()" please.

with that changed,
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>

> +        return '{:.2f}'.format(float(self.version))
> +
>  
>  class ParamsFactory(object):  # pylint: disable=too-few-public-methods
>      """A factory class that provides TestParam objects.
> @@ -220,7 +225,7 @@ class ParamsFactory(object):  # pylint: disable=too-few-public-methods
>  
>  def make_vs(name, params):
>      """Create a vertex shader test."""
> -    dirname = _DIRNAME.format(params.version)
> +    dirname = _DIRNAME.format(params.formated_version)
>      utils.safe_makedirs(dirname)
>      with open(os.path.join(dirname, name), 'w') as f:
>          f.write(_VS_TEMPLATE.render_unicode(params=params))
> @@ -229,7 +234,7 @@ def make_vs(name, params):
>  
>  def make_fs(name, params):
>      """Create a fragment shader test."""
> -    dirname = _DIRNAME.format(params.version)
> +    dirname = _DIRNAME.format(params.formated_version)
>      utils.safe_makedirs(dirname)
>      with open(os.path.join(dirname, name), 'w') as f:
>          f.write(_FS_TEMPLATE.render_unicode(params=params))
> -- 
> 1.9.1
> 
-------------- 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/20171117/efe2155f/attachment.sig>


More information about the Piglit mailing list