[Piglit] [PATCH 1/2] all.py: fix version checks in is_feature_directory_supported()

Dylan Baker dylan at pnwbakers.com
Mon Nov 13 22:04:03 UTC 2017


for the series:
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>

Quoting Brian Paul (2017-11-13 13:06:27)
> The wflinfo versions should be floats already, so don't call float() again.
> If querying the ES api/version fails, we'll get None for the version number
> so check for that.
> ---
>  tests/all.py | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/all.py b/tests/all.py
> index c322232..70f8efd 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -236,20 +236,20 @@ def is_feature_directory_supported(dir_name):
>          return gl_extension_supported(ext_name)
>      elif dir_name[:5] == "gles-":
>          # OpenGL ES test
> -        version = dir_name[5:]
> -        return float(version) <= float(wfl_info.gles_version)
> +        version = float(dir_name[5:])
> +        return wfl_info.gles_version != None and version <= wfl_info.gles_version
>      elif dir_name[:8] == "glsl-es-":
>          # OpenGL ES shader test
> -        version = dir_name[8:]
> -        return float(version) <= float(wfl_info.glsl_es_version)
> +        version = float(dir_name[8:])
> +        return wfl_info.glsl_es_version != None and version <= wfl_info.glsl_es_version
>      elif dir_name[:3] == "gl-":
>          # The directory is a GL version
> -        version = dir_name[3:]
> -        return float(version) <= float(wfl_info.gl_version)
> +        version = float(dir_name[3:])
> +        return version <= wfl_info.gl_version
>      elif dir_name[:5] == "glsl-":
>          # The directory is a GLSL version
> -        version = dir_name[5:]
> -        return float(version) <= float(wfl_info.glsl_version)
> +        version = float(dir_name[5:])
> +        return version <= wfl_info.glsl_version
>      else:
>          # The directory is something else.  Don't skip it.
>          return True
> -- 
> 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/20171113/2f2460dc/attachment.sig>


More information about the Piglit mailing list