summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2016-01-04 11:12:59 -0800
committerDylan Baker <baker.dylan.c@gmail.com>2016-01-08 12:25:21 -0800
commit8c2b750629c52f4d45b24ea346b79a5c65f7f201 (patch)
treeb3c8afa37c7462da49bcf0245c7e6034924480e7
parent317a0f0c6492641e0aecbd6cb097252ef81a2837 (diff)
framework/test/opengl.py: Add environment variable to turn off fast skipping
Setting PIGLIT_NO_FAST_SKIP will disable the fast skipping mechanism altogether. It does this by shadowing FastSkipMixin at import time. This method is robust and cheap, but makes testing difficult. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
-rw-r--r--README7
-rw-r--r--framework/test/opengl.py25
2 files changed, 32 insertions, 0 deletions
diff --git a/README b/README
index e48c23dd0..28d9ec5fb 100644
--- a/README
+++ b/README
@@ -297,6 +297,13 @@ behaves.
glslparsertest. This can be used to test ES<x>_COMPATABILITY extensions
for OpenGL
+ PIGLIT_NO_FAST_SKIP
+ Piglit has a mechanism run in the python layer for skipping tests with
+ unmet OpenGL or window system dependencies without starting a new
+ process (which is expensive). Sometimes this system doesn't work or is
+ undesirable, setting this environment variable to True will disable this
+ system.
+
3.2 Note
--------
diff --git a/framework/test/opengl.py b/framework/test/opengl.py
index 9cad32cd1..af0cc560b 100644
--- a/framework/test/opengl.py
+++ b/framework/test/opengl.py
@@ -24,6 +24,7 @@ from __future__ import absolute_import, division, print_function
import errno
import os
import subprocess
+import warnings
from framework import exceptions, core
from framework.options import OPTIONS
@@ -35,6 +36,10 @@ __all__ = [
'FastSkipMixin',
]
+# An environment variable that when set to true disables the FastSkipMixin by
+# stubbing it out
+_DISABLED = bool(os.environ.get('PIGLIT_NO_FAST_SKIP', False))
+
class StopWflinfo(exceptions.PiglitException):
"""Exception called when wlfinfo getter should stop."""
@@ -364,3 +369,23 @@ class FastSkipMixin(object):
self.glsl_es_version, self.__info.glsl_es_version))
super(FastSkipMixin, self).is_skip()
+
+
+class FastSkipMixinDisabled(object):
+ def __init__(self, *args, **kwargs):
+ # Tests that implement the FastSkipMixin expect to have these values
+ # set, so just fill them in with the default values.
+ self.gl_required = set()
+ self.gl_version = None
+ self.gles_version = None
+ self.glsl_version = None
+ self.glsl_es_version = None
+
+ super(FastSkipMixinDisabled, self).__init__(*args, **kwargs)
+
+
+# Shadow the real FastSkipMixin with the Disabled version if
+# PIGLIT_NO_FAST_SKIP is truthy
+if _DISABLED:
+ warnings.warn('Fast Skipping Disabled')
+ FastSkipMixin = FastSkipMixinDisabled