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

Charmaine Lee charmainel at vmware.com
Fri Nov 17 20:40:37 UTC 2017


Looks good.

Reviewed-by: Charmaine Lee <charmainel at vmware.com>

________________________________________
From: Brian Paul <brianp at vmware.com>
Sent: Friday, November 17, 2017 12:03:40 PM
To: piglit at lists.freedesktop.org
Cc: Charmaine Lee; Dylan Baker; Brian Paul
Subject: [PATCH] generators: fix incorrect generated_tests/spec/glsl-110, etc. dir names

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
+        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



More information about the Piglit mailing list