[Piglit] [PATCH] generated_tests: Add positional argument specifiers.

Brian Paul brianp at vmware.com
Thu May 31 07:30:58 PDT 2012


On 05/31/2012 12:18 AM, Vinson Lee wrote:
> Fix build failure with Python 2.6 introduced at commit
> 8460edff15defcfd8e26c87989cf9c961a4b2434.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
>   generated_tests/gen_builtin_uniform_tests.py     |    4 ++--
>   generated_tests/gen_constant_array_size_tests.py |    4 ++--
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/generated_tests/gen_builtin_uniform_tests.py b/generated_tests/gen_builtin_uniform_tests.py
> index ffaa545..75a1b59 100644
> --- a/generated_tests/gen_builtin_uniform_tests.py
> +++ b/generated_tests/gen_builtin_uniform_tests.py
> @@ -453,7 +453,7 @@ class ShaderTest(object):
>   	argtype_names = '-'.join(
>   	    str(argtype) for argtype in self._signature.argtypes)
>   	return os.path.join(
> -	    'spec', 'glsl-{:1.2f}'.format(float(self.glsl_version()) / 100),
> +	    'spec', 'glsl-{0:1.2f}'.format(float(self.glsl_version()) / 100),
>   	    'execution', 'built-in-functions',
>   	    '{0}-{1}-{2}{3}.shader_test'.format(
>   		self.test_prefix(), self._signature.name, argtype_names,
> @@ -462,7 +462,7 @@ class ShaderTest(object):
>       def generate_shader_test(self):
>   	"""Generate the test and write it to the output file."""
>   	shader_test = '[require]\n'
> -	shader_test += 'GLSL>= {:1.2f}\n'.format(float(self.glsl_version()) / 100)
> +	shader_test += 'GLSL>= {0:1.2f}\n'.format(float(self.glsl_version()) / 100)
>   	shader_test += '\n'
>   	shader_test += '[vertex shader]\n'
>   	shader_test += self.make_vertex_shader()
> diff --git a/generated_tests/gen_constant_array_size_tests.py b/generated_tests/gen_constant_array_size_tests.py
> index 33c37c6..a9a5991 100644
> --- a/generated_tests/gen_constant_array_size_tests.py
> +++ b/generated_tests/gen_constant_array_size_tests.py
> @@ -151,7 +151,7 @@ class ParserTest(object):
>   	argtype_names = '-'.join(
>   	    str(argtype) for argtype in self.__signature.argtypes)
>   	return os.path.join(
> -	    'spec', 'glsl-{:1.2f}'.format(float(self.glsl_version()) / 100),
> +	    'spec', 'glsl-{0:1.2f}'.format(float(self.glsl_version()) / 100),
>   	    'compiler', 'built-in-functions',
>   	    '{0}-{1}.{2}'.format(
>   		self.__signature.name, argtype_names, self.test_suffix()))
> @@ -160,7 +160,7 @@ class ParserTest(object):
>   	"""Generate the test and write it to the output file."""
>   	parser_test = '/* [config]\n'
>   	parser_test += ' * expect_result: pass\n'
> -	parser_test += ' * glsl_version: {:1.2f}\n'.format(float(self.glsl_version()) / 100)
> +	parser_test += ' * glsl_version: {0:1.2f}\n'.format(float(self.glsl_version()) / 100)
>   	parser_test += ' * [end config]\n'
>   	parser_test += ' *\n'
>   	parser_test += ' * Check that the following test vectors are constant folded correctly:\n'

I've never used the str.format() stuff but I checked the 2.6 docs and 
this looks right.

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the Piglit mailing list