summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2018-02-02 09:41:51 -0700
committerBrian Paul <brianp@vmware.com>2018-02-02 14:47:38 -0700
commit8ca6c82cdd00d9e1104ef7f9565632dbfc2d3fc4 (patch)
tree9eb06990524b0f624244d8b697271adfa1fbbf64
parent032830f2f121515648f5f60bfd1a48eeee4d5958 (diff)
all.py: fix extension/version testing when wflinfo fails
If wflinfo is not installed or fails, the wfl_info.gl_extensions value will be the empty set. Similarly, the gl_version, glsl_version, etc. will be None. In those cases, return True from the gl_extension_supported() and is_feature_directory_supported() functions so that we don't skip any subdirs. This is only relevant when PIGLIT_FILTER_DIRECTORIES is set. Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
-rw-r--r--tests/all.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/all.py b/tests/all.py
index 6d4e887b3..a681cd26e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -217,6 +217,10 @@ wfl_info = wflinfo.WflInfo()
def gl_extension_supported(ext_name):
"""Is the named OpenGL extension supported?"""
+ if wfl_info.gl_extensions == set():
+ # Don't know what extensions are supported. Return true so we don't
+ # skip anything.
+ return True
return ext_name in wfl_info.gl_extensions
@@ -227,6 +231,9 @@ def is_feature_directory_supported(dir_name):
it means the extension/version is possibly suppported. We're a little
fuzzy because we don't yet parse all the directory name possibilities
(like ES tests).
+
+ Also, if the 'wflinfo' program is not installed or fails (i.e. we can't
+ determine the GL version/extension) we return True.
"""
if dir_name[:4] in {"amd_", "arb_", "ati_", "ext_", "khr_", "oes_"}:
# The directory is a GL extension name, but of the format "arb_foo_bar"
@@ -237,19 +244,19 @@ def is_feature_directory_supported(dir_name):
elif dir_name[:5] == "gles-":
# OpenGL ES test
version = float(dir_name[5:])
- return wfl_info.gles_version != None and version <= wfl_info.gles_version
+ return wfl_info.gles_version is None or version <= wfl_info.gles_version
elif dir_name[:8] == "glsl-es-":
# OpenGL ES shader test
version = float(dir_name[8:])
- return wfl_info.glsl_es_version != None and version <= wfl_info.glsl_es_version
+ return wfl_info.glsl_es_version is None or version <= wfl_info.glsl_es_version
elif dir_name[:3] == "gl-":
# The directory is a GL version
version = float(dir_name[3:])
- return version <= wfl_info.gl_version
+ return wfl_info.gl_version is None or version <= wfl_info.gl_version
elif dir_name[:5] == "glsl-":
# The directory is a GLSL version
version = float(dir_name[5:])
- return version <= wfl_info.glsl_version
+ return wfl_info.glsl_version is None or version <= wfl_info.glsl_version
else:
# The directory is something else. Don't skip it.
return True