summaryrefslogtreecommitdiff
path: root/framework/tests
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-11-03 12:10:33 -0800
committerDylan Baker <baker.dylan.c@gmail.com>2015-11-16 14:53:06 -0800
commit808fda2b23becade8ca313d501bedc5427bbac26 (patch)
treea95fbcedd94151ec1af3a16270e681a46b316619 /framework/tests
parent5dfee8c93661182a35a9cb12730064d16c26cb69 (diff)
framework/test/glsl_parser_test.py: add support for GLSL (ES) based skipping.
On the glslparser profile I see a roughly ~15 second speedup on my HSW with this patch. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework/tests')
-rw-r--r--framework/tests/glsl_parser_test_tests.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/framework/tests/glsl_parser_test_tests.py b/framework/tests/glsl_parser_test_tests.py
index c954e80f0..b837723c1 100644
--- a/framework/tests/glsl_parser_test_tests.py
+++ b/framework/tests/glsl_parser_test_tests.py
@@ -378,6 +378,40 @@ def test_get_glslparsertest_gles2():
yield test, content.format(version)
+def test_set_glsl_version():
+ """test.glsl_parser_test.GLSLParserTest: sets glsl_version"""
+ rt = {'glsl_version': '4.3'}
+ with mock.patch.object(glsl.GLSLParserTest, '_GLSLParserTest__parser',
+ mock.Mock(return_value=rt)):
+ with mock.patch.object(glsl.GLSLParserTest,
+ '_GLSLParserTest__get_command'):
+ with mock.patch('framework.test.glsl_parser_test.super',
+ mock.Mock()):
+ with mock.patch('framework.test.glsl_parser_test.open',
+ mock.mock_open()):
+ with mock.patch('framework.test.glsl_parser_test.os.stat',
+ mock.mock_open()):
+ test = glsl.GLSLParserTest('foo')
+ nt.eq_(test.glsl_version, 4.3)
+
+
+def test_set_glsl_es_version():
+ """test.glsl_parser_test.GLSLParserTest: sets glsl_es_version"""
+ rt = {'glsl_version': '3.00 es'}
+ with mock.patch.object(glsl.GLSLParserTest, '_GLSLParserTest__parser',
+ mock.Mock(return_value=rt)):
+ with mock.patch.object(glsl.GLSLParserTest,
+ '_GLSLParserTest__get_command'):
+ with mock.patch('framework.test.glsl_parser_test.super',
+ mock.Mock()):
+ with mock.patch('framework.test.glsl_parser_test.open',
+ mock.mock_open()):
+ with mock.patch('framework.test.glsl_parser_test.os.stat',
+ mock.mock_open()):
+ test = glsl.GLSLParserTest('foo')
+ nt.eq_(test.glsl_es_version, 3.0)
+
+
def test_set_gl_required():
"""test.glsl_parser_test.GLSLParserTest: sets glsl_es_version"""
rt = {'require_extensions': 'GL_ARB_foobar GL_EXT_foobar'}