summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-08-16 14:02:52 -0700
committerDylan Baker <dylan@pnwbakers.com>2016-08-23 11:39:20 -0700
commit67e82910c756061faf77b54009dcff04fda86b52 (patch)
treeb88c9f5a18d40af81780dea2ae4cd659b317153a /unittests
parent7e9c1fc84740a676ea5d2baf3a2ed89e174ebc8e (diff)
framework: fix PIGLIT_NO_FAST_SKIP.
The signature of the stub version was not updated when the real version was, which means setting the environment variable will raise an exception. Also adds some tests for this problem. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Tested-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'unittests')
-rw-r--r--unittests/framework/test/test_opengl.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/unittests/framework/test/test_opengl.py b/unittests/framework/test/test_opengl.py
index e782d33bb..63813738d 100644
--- a/unittests/framework/test/test_opengl.py
+++ b/unittests/framework/test/test_opengl.py
@@ -417,6 +417,16 @@ class TestFastSkipMixin(object): # pylint: disable=too-many-public-methods
def inst(self):
return self._Test(['foo'])
+ def test_api(self):
+ """Tests that the api works.
+
+ Since you're not suppoed to be able to pass gl and gles version, this
+ uses two seperate constructor calls.
+ """
+ self._Test(['foo'], gl_required={'foo'}, gl_version=3, glsl_version=2)
+ self._Test(['foo'], gl_required={'foo'}, gles_version=3,
+ glsl_es_version=2)
+
def test_should_skip(self, inst):
"""test.opengl.FastSkipMixin.is_skip: Skips when requires is missing
from extensions.
@@ -554,3 +564,34 @@ class TestFastSkipMixin(object): # pylint: disable=too-many-public-methods
def test_max_glsl_es_version_set(self, inst):
"""test.opengl.FastSkipMixin.is_skip: runs if glsl_es_version is None"""
inst.is_skip()
+
+
+class TestFastSkipMixinDisabled(object):
+ """Tests for the sub version."""
+
+ @pytest.yield_fixture(autouse=True, scope='class')
+ def patch(self):
+ """Create a Class with FastSkipMixin, but patch various bits."""
+ _mock_wflinfo = mock.Mock(spec=opengl.WflInfo)
+ _mock_wflinfo.gl_version = 3.3
+ _mock_wflinfo.gles_version = 3.0
+ _mock_wflinfo.glsl_version = 3.3
+ _mock_wflinfo.glsl_es_version = 2.0
+ _mock_wflinfo.gl_extensions = set(['bar'])
+
+ with mock.patch.object(self._Test, '_FastSkipMixin__info',
+ _mock_wflinfo):
+ yield
+
+ class _Test(opengl.FastSkipMixin, utils.Test):
+ pass
+
+ def test_api(self):
+ """Tests that the api works.
+
+ Since you're not suppoed to be able to pass gl and gles version, this
+ uses two seperate constructor calls.
+ """
+ self._Test(['foo'], gl_required={'foo'}, gl_version=3, glsl_version=2)
+ self._Test(['foo'], gl_required={'foo'}, gles_version=3,
+ glsl_es_version=2)